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: [BUG] pragma: attempt to use poisoned * in struct member


>>>>> "Jiri" == Jiri Slaby <jirislaby@gmail.com> writes:

Jiri> while compiling slightly augmented cc1, I've found a poison
Jiri> pragma bug. Here comes a trimmed example of the bug:

Jiri> $ echo -e '#pragma GCC poison malloc\nstruct { int malloc; };'|gcc - -E -o/dev/null
Jiri> <stdin>:2:14: error: attempt to use poisoned "malloc"

Could you explain what you think the bug is?

My first reaction is that this is not a bug.  #pragma poison works on
identifiers, no matter what context they appear in (outside of system
headers).  For this reason, poison is not always useful.
__attribute__((deprecated)) might be closer to what you want, though
it can be hard to use that with system-declared functions like malloc.

Tom


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