Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute
Home

[Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Thu, 27 Feb 2003 01:18:39 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, Feb 27, 2003 at 12:37:16AM -0800, Jason Short wrote:
> 
> [rfalke - Wed Feb 26 20:33:43 2003]:
> 
> > On Tue, Feb 18, 2003 at 12:39:22PM -0800, Raimar Falke wrote:
> > > There is another solution:
> > > 
> > > #define die(x)   real_die(x),exit(1)
> > 
> > Attached is the patch. It compiles with gcc3.2 and icc6.0
> 
> I suspect the variadic arguments used in the macro are non-standard. 
> Elsewhere, in freelog(), variadic arguments are not used with non-gcc
> compilers.  goto_log and friends were made into functions because of
> this.  This is potentially a much bigger issue than just compiler
> warnings; if the compiler doesn't understand this syntax compilation
> will completely fail.
> 
> Can you point to any documentation on portably using variadic arguments
> in macros?

This construct is part of the C99 standard.

6.10.3.1 Argument substitution
...

An identifier __VA_ARGS__ that occurs in the replacement list shall be
treated as if it were a parameter, and the variable arguments shall
form the preprocessing tokens used to replace it.

There is also a nice example of its usage in "6.10.3.5 Scope of macro
definitions".

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  Microsoft does have a year 2000 problem. I'm part of it. I'm running Linux.




[Prev in Thread] Current Thread [Next in Thread]