ENORMOUS Pb with VC7 linker optimisation ! 
Author Message
 ENORMOUS Pb with VC7 linker optimisation !

Hi !
I found an enormous bug in my VC7 Release project : I read an archive file
written few weeks ago by the same project but compiled with VC6. Inside this
archive, one of my derived CObject class was written.
Now, in Debug, no pb.
In Release, I catch a CArchiveException because the class name is not found
in runtimeclass global list !!!! Why ? It seems to be an optimisation bug of
the linker, because when I put "Keep Unreferenced Data (/OPT:NOREF)" in
linker options, it works !!!!!!!
Note that the class is used as local variable in a function of my project,
so it is referenced...
Any explanations ?

--
Emmanuel Derriey
WinLog SA : http://www.*-*-*.com/



Sun, 03 Jul 2005 01:39:14 GMT  
 ENORMOUS Pb with VC7 linker optimisation !


Quote:

>Hi !
>I found an enormous bug in my VC7 Release project : I read an archive file
>written few weeks ago by the same project but compiled with VC6. Inside this
>archive, one of my derived CObject class was written.
>Now, in Debug, no pb.
>In Release, I catch a CArchiveException because the class name is not found
>in runtimeclass global list !!!! Why ? It seems to be an optimisation bug of
>the linker, because when I put "Keep Unreferenced Data (/OPT:NOREF)" in
>linker options, it works !!!!!!!
>Note that the class is used as local variable in a function of my project,
>so it is referenced...
>Any explanations ?

Might your problem be related to the bug described in the post below?

http://groups.google.com/groups?th=d9851ea2869caaa8

Jon



Sun, 03 Jul 2005 04:28:11 GMT  
 ENORMOUS Pb with VC7 linker optimisation !
Jon
Thanks for your answer. It seems to be the problem I had, but why, in my
case, is it resolved by changing Linker option ?
In article you gave me, C++ had been modified to solve the problem !

--
Emmanuel Derriey
WinLog SA : http://www.winlog.com



Quote:
> On Tue, 14 Jan 2003 18:39:14 +0100, "Emmanuel Derriey"


Quote:

> >Hi !
> >I found an enormous bug in my VC7 Release project : I read an archive
file
> >written few weeks ago by the same project but compiled with VC6. Inside
this
> >archive, one of my derived CObject class was written.
> >Now, in Debug, no pb.
> >In Release, I catch a CArchiveException because the class name is not
found
> >in runtimeclass global list !!!! Why ? It seems to be an optimisation bug
of
> >the linker, because when I put "Keep Unreferenced Data (/OPT:NOREF)" in
> >linker options, it works !!!!!!!
> >Note that the class is used as local variable in a function of my
project,
> >so it is referenced...
> >Any explanations ?

> Might your problem be related to the bug described in the post below?

> http://groups.google.com/groups?th=d9851ea2869caaa8

> Jon



Sun, 03 Jul 2005 16:53:52 GMT  
 ENORMOUS Pb with VC7 linker optimisation !

Quote:

> Jon
> Thanks for your answer. It seems to be the problem I had, but why, in my
> case, is it resolved by changing Linker option ?
> In article you gave me, C++ had been modified to solve the problem !

> --
> Emmanuel Derriey
> WinLog SA : http://www.winlog.com

It's difficult to know for sure why /opt:noref would hide this problem in
your project.  It's possible that the way MFC uses __declspec(selectany)
might be triggering this.  What seems clear, though, is that the real issue
is a bug in the IMPLEMENT_SERIAL implementation, as described in
http://groups.google.com/groups?th=d9851ea2869caaa8.  The bug is also
referenced by KB article 322621,
http://support.microsoft.com/default.aspx?scid=kb;en-us;322621.

--
Phil Lucido, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.



Tue, 12 Jul 2005 03:50:05 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Pb with VC7 with CString and VARIANT...

2. Pb with MsVC++ linker...

3. Bug in VC7 Linker

4. Linker error with function templates in VC7.1

5. Linker problems w/ VC7 and non-called C++ constructors

6. STL queue linker error moving from VC6 to VC7

7. possible bug in VC6, VC7, VC7.1

8. Possible bug in vc7.0 (and vc7.1)

9. VC6 to VC7 dotnet beta2 porting problems Optimisation problems and 'minimise use of CRT in ATL' problem

10. Binary tree optimisation

11. Optimisation In C and Algorithm Develpment

12. Algorithm Optimisation Thoughts - Languageh Independent Stage Of Development

 

 
Powered by phpBB® Forum Software