This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [BUG] pragma: attempt to use poisoned * in struct member
- From: Tom Tromey <tromey at redhat dot com>
- To: Jiri Slaby <jirislaby at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 08 Nov 2008 08:46:37 -0700
- Subject: Re: [BUG] pragma: attempt to use poisoned * in struct member
- References: <4915922A.4030108@gmail.com>
- Reply-to: tromey at redhat dot com
>>>>> "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