deprecated GNU ## extension used

Neil Booth NeilB@earthling.net
Tue Jul 11 15:23:00 GMT 2000


Ulrich Drepper wrote:-

> This is real code I'm using.  Andreas' example showed another case:
> the ISO C99 varargs list can never be empty.

Hi Ulrich,

The problem I have with this is that firstly this use of ## has
nothing to do with token pasting, and secondly that it breaks real
standards-conforming code, i.e. you can write a program that obeys the
ISO rules that will fail to compile with gcc.  I certainly wouldn't
call it superior, and would suggest using some other operator if we
decide we want to maintain the functionality.

An example Zack gave:-

#define prefix(...) do_ ## __VA_ARGS__
prefix(a, b, c, d)
prefix()

must come out as

do_a, b, c, d
do_

Your line number example could be achieved by rewriting your code to
include the %d and line number in the format and arguments.

Neil.


More information about the Libc-alpha mailing list