This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: deprecated GNU ## extension used


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]