wrong public reference (g++ v2.8.0)
Mark Mitchell
mmitchell@usa.net
Mon Mar 23 07:10:00 GMT 1998
>>>>> "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
More information about the Gcc-bugs
mailing list