This is the mail archive of the gcc-bugs@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]

Re: wrong public reference (g++ v2.8.0)


>>>>> "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


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