This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rfc: macros accepting constructors


On Wed, Jun 26, 2002 at 10:36:06AM +0200, Andreas Schwab wrote:
> Aldy Hernandez <aldyh@redhat.com> writes:
> 
> |> the cleanest solution i can think of is modifying the preprocessor to
> |> allow grouping with curlies as well.
> 
> That would not be compliant with the C standard.

i know, but neither will any standard library functions that are 
implemented as macros.  take a pick: a little flexibility on macro
arguments, or inability to pass constant aggregates to library functions 
(that have been implemented as macros).  you can't have both.

of course, this wouldn't be implemented for -ansi.

> |>  can anyone think of a better solution?
> 
> Put parens around the argument.  IMHO, the C standard should have made
> them part of the syntax for compound literals.

but they're not part of the ISO C standard :-(

aldy


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