This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Does C++ std::queue really conflict with C header 'struct queue'?
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: phil at jaj dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 26 Jul 2003 00:25:29 -0400
- Subject: Re: Does C++ std::queue really conflict with C header 'struct queue'?
Phil Edwards wrote:
>On Fri, Jul 25, 2003 at 10:17:16PM -0400, Nathanael Nerode wrote:
>> The following hunk of code from fixinc.svr4 purports to fix a
>problem,
>which I
>> think may not be a problem.
>>
>> The claim is that 'struct queue' in sys/stream.h conflicts with the
>> 'queue' class in C++ headers. This seems wrong to me because the C++
>> queue class is in namespace std, and I don't see why the sys/stream.h
>> version would be.
>
>My guess is that it dates from the days when gcc didn't have proper
>namespace support. Tomorrow I'll try removing that fix and see whether
>anything breaks on solaris.
Thanks for picking up on this! That's what I guessed, but I wasn't
comfortable with it until a C++ person said it. :-)
I doubt that Solaris comes out of config.guess as "*-*-svr4*", though,
so I think it doesn't use the fixinc.svr4 script, the only one
which still has that fix.
There is a similar issue related to math.h defining 'struct exception',
which also appears in regular fixincludes. Is this essentially the
same situation, or is there some added wrinkle introduced because of the
forwarding headers or something? (If so, is this better fixed in
'fixincludes' or in the forwarding headers?)
If this is essentially the same case, you could try removing *that* fix
(hackname 'math_exception'). (I can't check that either, since my only
machine uses glibc, which already has essentially incorporated the
fixincludes fix into its math.h.)
Mantra: Anything I can delete is a good thing. :-)
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html