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]

Re: Function-like macro definitions


Neil Booth wrote:
> Also, I'm considering reducing the status of redefinitions like
> 
> #define F(X) X
> #define F(Y) Y
> 
> where the only difference is the spelling of the parameters, from hard
> error to pedantic warning.

For C++ (if my reading of the standard is incorrect), the example
above is ill-formed and requires a diagnostic; so, although it can be
a warning, it shouldn't require -pedantic (in conforming mode, that is).

I don't know about C, though.

    Brane

-- 
Branko Čibej                 <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 1) 586 53 49     fax: (+386 1) 586 52 70

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