This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: wrong public reference (g++ v2.8.0)
- To: hornet at reksoft dot ru
- Subject: Re: wrong public reference (g++ v2.8.0)
- From: Mark Mitchell <mmitchell at usa dot net>
- Date: Mon, 23 Mar 1998 07:12:37 -0800
- CC: egcs-bugs at cygnus dot com
- References: <3510DEFB.CD638A9C@reksoft.ru> <199803222056.MAA13652@ smtp.earthlink.net> <3516445A.C5B4D80@reksoft.ru>
- Reply-to: mmitchell at usa dot net
>>>>> "Igor" == Igor Levko <hornet@reksoft.ru> writes:
Igor> Hello,
Igor> Thanks for the answer. I started thinking that I would
Igor> recieve nothing.
Many of us our rather busy, and some of us work for free, so it
sometimes take a while for us to get back to you.
Igor> The main problem is that if you compile several sources, you
Igor> will not recieve either an error or a warning but the
Igor> compiler generates the different public references for the
Igor> 'Test'. That means you will get error after linking because
Igor> you will have the public reference foo(._0 const *) in one
Igor> file but in another one it will be foo(._1 const *). IMHO
Igor> this is wrong because it is to be handled somehow, the
Igor> compiler could issue a warning message at least.
I understand the problem; the point is that it is in fact a bug in
your code. The standard simply prevents us from doing what you would
like done here. You must say:
typedef const struct NonConstTest { int x; } Test, *pTest;
to do what you want.
--
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available