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


   Date: Wed, 12 Jul 2000 23:29:02 -0700
   From: Zack Weinberg <zack@wolery.cumb.org>

   would it be acceptable if the special behavior of ## keyed off the
   rest argument receiving zero actual arguments?

Yes, I think that will work.  Good suggestion.

   #define error(format, args...) \
	   fprintf(stderr, "%s:%d " format, file, line, ##args)
   error("0", a, b, c)
   error("1", )
   error("2")

   Note that "0" will receive a warning about an illegal token paste;
   perhaps that should be disabled in this context.

Yes, it should be disabled, as this is common and documented use.

   Or perhaps -Wpaste should not be enabled by -Wall, only -W or
   -pedantic.

That might be another way to do it.

   The existing general suppression of -pedantic in system headers should
   suffice to prevent the warning for "2".

How will this work, exactly?  The token paste itself will occur in the
user's program, not in the system header, so it appears to me that a
warning will be generated.

   I think the ability to give the rest argument a name will be
   acceptable to the committee.

I hope you have better luck than I did at overcoming the committee's
indifference toward GCC.  They'll listen if a GCC representative
physically attends their meetings regularly; otherwise I suspect you
may be out of luck.

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