This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rfc: macros accepting constructors
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: jason at redhat dot com, gcc at gcc dot gnu dot org, geoffk at redhat dot com
- Date: Wed, 26 Jun 2002 16:12:21 -0700
- Subject: Re: rfc: macros accepting constructors
- References: <20020626074154.GA810@redhat.com> <jesn3a8mix.fsf@sykes.suse.de>
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