delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/26/18:16:32

Message-ID: <379CDE99.3E957B4@unb.ca>
Date: Mon, 26 Jul 1999 18:18:01 -0400
From: Endlisnis <s257m AT unb DOT ca>
X-Mailer: Mozilla 4.51 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com
Subject: Re: __attribute__((unused)), gcc get's confused...?
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990726093100 DOT 27650E AT is>
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:

> On Sun, 25 Jul 1999, Endlisnis wrote:
> > I'm having a problem with unused parameters.  This code:
> > char **__crt0_glob_function (__attribute__((unused)) char * _argument)
> __attribute__ should come *after* the name, like this:
>  char **__crt0_glob_function (char * _argument __attribute__((unused)))
> If you study carefully the GCC docs that describe __attribute__, you
> will see that all the examples there put __attribute__ after the name,
> not before it.

    I had looked in the info pages for gcc, and I did find that, but the way I
posted it was the only way it didn't get a parse error.  Here is a program I
tried just now.  And the output from gcc.

int main(int argc __attribute__((unused)), char** argv)
{
 return 0;
 }
 b.cc(1) Error: parse error before `__attribute__'
 In function `int main(...)':
 b.cc(4) Error: confused by earlier errors, bailing out
 There were some errors

I'm using gcc v2.8.1
--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT HotMail DOT com
          ICQ: 32959047


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019