Internal Compiler Error with VS 2003

The place to discuss creating, porting and modifying Celestia's source code.
Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Internal Compiler Error with VS 2003

Post #1by t00fri » 10.08.2008, 18:07

For the first time, I get an internal compiler error with my VS 2003 compiler and latest Rev. 4404.

It happens in parseobject.cpp :

This line

if (planetData->getVector("LongLat", longlat) && system != NULL)

gives

c:\Develop\celestia\src\celengine\parseobject.cpp(765): fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2708)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information


It's gone if I modify the line into

if (planetData->getVector("LongLat", longlat) )

and everything builds and runs fine. So what would be a workaround to make things continue to run with VS2003 ??

Fridger
Image

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Internal Compiler Error with VS 2003

Post #2by chris » 12.08.2008, 00:22

This is a bug in VC2003. But, there's also an error in the code, albeit an innocuous one. The function ParseObject used to take a parameter called system, but this parameter is no longer necessary. The test for system != NULL should have been removed when the function was changed. Ordinarily, the compiler would generate an error if a function tried to reference a non-existent variable. But, there's a C library function named system so the code continues to build. Since the system function is always defined, the expression system != NULL will always return true, making it completely extraneous and confusing. It shouldn't trigger an internal compiler error, but whatever . . . In this case, your modification is both a workaround for the compiler bug and what the code is *supposed* to look like. Please check in the change.

--Chris

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Internal Compiler Error with VS 2003

Post #3by t00fri » 12.08.2008, 16:41

chris wrote:This is a bug in VC2003. But, there's also an error in the code, albeit an innocuous one. The function ParseObject used to take a parameter called system, but this parameter is no longer necessary. The test for system != NULL should have been removed when the function was changed. Ordinarily, the compiler would generate an error if a function tried to reference a non-existent variable. But, there's a C library function named system so the code continues to build. Since the system function is always defined, the expression system != NULL will always return true, making it completely extraneous and confusing. It shouldn't trigger an internal compiler error, but whatever . . . In this case, your modification is both a workaround for the compiler bug and what the code is *supposed* to look like. Please check in the change.

--Chris

Done!

Now it's revision 4406.

Fridger
Image

duds26
Posts: 328
Joined: 05.02.2007
Age: 34
With us: 17 years 9 months
Location: Europe

Re: Internal Compiler Error with VS 2003

Post #4by duds26 » 09.11.2008, 11:30

You could check if there are updates for your VS 2003 or do you already have the latest version?
(Graphical interface: menu>Help>(search something that says updates or something like that) )

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Internal Compiler Error with VS 2003

Post #5by t00fri » 09.11.2008, 12:21

duds26 wrote:You could check if there are updates for your VS 2003 or do you already have the latest version?

Of course. ;-)

Fridger
Image


Return to “Development”