This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

Re: [patch] Error on setenv(..., NULL, ...)


Paul Pluzhnikov wrote:
I assume you also know about DIAG_PUSH_NEEDS_COMMENT /
DIAG_POP_NEEDS_COMMENT, which then makes me not understand your
comment about selective pacification.

When I tried to use those macros, I still got the warning and the build still failed. Part of the problem is that 'vallen' gets used as part of an argument to the __mempcpy/memcpy macros, and GCC decides that since 'vallen' is used in the macro body, it'll issue a warning since the macro body is outside the "scope" of the DIAG_PUSH* and DIAG_POP* brackets. It's the classic problem of macro capture.

I couldn't even use plain DIAG_IGNORE_NEEDS_COMMENT (i.e., without DIAG_PUSH_NEEDS_COMMENT), because I needed to put the #pragma before including <errno.h> (the first standard include) -- otherwise I got the warning -- and DIAG_IGNORE_NEEDS_COMMENT isn't defined until after <errno.h> is included.

I was using GCC 4.9.2 20150212 (Red Hat 4.9.2-6), for what that's worth.


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