The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
November 25, 2020, 09:05:13 am
Home Help Search Login Register
News: Paul & Fred have reached a settlement with Stardock!

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Compilation warnings
« previous next »
Pages: [1] Print
Author Topic: Compilation warnings  (Read 2732 times)
Eric Pierce
Guest


Email
Compilation warnings
« on: December 02, 2002, 06:36:53 am »

I get a couple of warnings during compilation. Don't know if these are related to the segfaults I'm getting when I run uqm, but they may need looking into.

The first, which is repeated often during compilation, is a warning about right-shifting by a negative value. Looking into the code, these seem to occur in any function which calls:

SET_GAME_STATE ( XXX, 1 );

Where XXX is various things like STARBASE_BULLETS0, STARBASE_VISITED, LIGHT_MINERAL_LOAD, etc. Presumably it is something amiss in the SET_GAME_STATE macro, in $SRCDIR/src/sc2code/globdata.h, or functions calling the macro with inappropriate values.

The other error only occurs when finishing up compilation and linking of all the .o files into the main executable, and is as follows:

obj/release/src/sc2code/libs/file/temp.o: In function `initTempDir':
obj/release/src/sc2code/libs/file/temp.o(.text+0x17): the use of `tmpnam' is dangerous, better use `mkstemp'

Just for kicks, I tried changing the line in question as the compiler recommends, and instead of getting a segfault when I run uqm, I get some errors about "Cannot create tempfile - file does not exist."

Hope this helps!
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Compilation warnings
« Reply #1 on: December 02, 2002, 05:26:17 pm »

SET_GAME_STATE and GET_GAME_STATE are the cause of all the shifting warnings. But despite the warnings, it is original code that works. We'll be changing this at some time to get rid of the warning, but for the moment, we're more busy on things that *do* go wrong.
As for tmpnam, you can ignore it. The reason for the warning is that incorrect use can be a security risk. mkstemp isn't an alternative as it creates a temporary file, while we want a directory. There are unfortunately no portable functions we can use, except for tmpnam. Maybe we'll write our own function at some point.
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Eric Pierce
Guest


Email
Re: Compilation warnings
« Reply #2 on: December 02, 2002, 10:01:06 pm »

I kind of figured that... guess I'll have to look elsewhere for the cause of the segfaults.

I'll try using gdb to see if that helps locate the cause. I might even be able to fix it myself Smiley

Logged
Eric Pierce
Guest


Email
Re: Compilation warnings
« Reply #3 on: December 03, 2002, 12:37:26 am »

Ah!

Apparently the segfaults are related to not having permissions in the installation directory (I'm on Linux). Tried running the executable from the source directory (where I *do* have write permission) and it worked great!

Most of the sound works fine, except it does not play any of the .ogg files. Maybe I forgot some of the required libs...

Anyhow, kudos to everyone that is working on this! This was definitely one of my favorite games from the DOS days, and it's awesome to play it again.
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Compilation warnings
« Reply #4 on: December 03, 2002, 01:57:17 am »

Quote
Most of the sound works fine, except it does not play any of the .ogg files. Maybe I forgot some of the required libs...

You need the cvs version of SDL_mixer. Their 'stable' release doesn't support ogg yet. (We're planning to switch to OpenAL though).
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!