This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH] Do not expand macros to 'defined'


On 2019-01-16 15:48, Andreas Schwab wrote:
On Jan 16 2019, Simon Marchi <simon.marchi@polymtl.ca> wrote:

The patch LGTM, I agree these macros are not really needed.  But I am
confused, does this actually fix your c++ build? You mentioned you were
using g++ (and therefore cpp), which supposedly can handle this fine:

https://gcc.gnu.org/onlinedocs/cpp/Defined.html

If so, what did the error look like?

This has nothing to do with C vs. C++, both have the same wording:

    If the token defined is generated as a result of this replacement
    process or use of the defined unary operator does not match one of
    the two specified forms prior to macro replacement, the behavior is
    undefined.

Andreas.

That's why I was confused, the purpose of Pavel's patch that was replaced by this one is C++-oriented:

https://sourceware.org/ml/gdb-patches/2019-01/msg00241.html

So in the end it looks like the issue is indeed not about C++, but about his usage of -Wextra (-Wexpansion-to-defined).

Simon


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