Opened 14 years ago

Closed 14 years ago

Last modified 10 months ago

#1996 closed defect (fixed)

Compilation error while trying to compile with gcc-4.0

Reported by: (none) Owned by: fingolfin
Priority: normal Component: Port: Linux
Keywords: Cc:
Game:

Description

When trying to compile ScummVM with a prerelease of GCC
4.0 (as supplied in Fedora Core development) I get this
compile error:

g++
-Wp,-MMD,"scumm/.deps/imuse.d",-MQ,"scumm/imuse.o",-MP
-Wall -g -ansi -W -Wno-unused-parameter -O
-Wuninitialized -Wno-long-long -Wno-multichar
-Wno-unknown-pragmas -pedantic -Wpointer-arith
-Wcast-qual -Wconversion -Wshadow -Wimplicit -Wundef
-Wnon-virtual-dtor -Wno-reorder -Wwrite-strings
-fcheck-new -Wctor-dtor-privacy -DHAVE_CONFIG_H -DUNIX
-DDISABLE_KYRA -DDISABLE_GOB -I. -I. -I./common
-I/usr/include/SDL -D_REENTRANT -Itest/cxxtest -c
scumm/imuse.cpp -o scumm/imuse.o
./scumm/music.h:40: warning: 'class Scumm::MusicEngine'
only defines private constructors and has no friends
./scumm/instrument.h:35: warning: 'class
Scumm::InstrumentInternal' only defines private
constructors and has no friends
./scumm/instrument.h:35: warning: 'class
Scumm::InstrumentInternal' has virtual functions but
non-virtual destructor
./scumm/instrument.h: In member function
'Scumm::Instrument::operator int()':
./scumm/instrument.h:76: error: cast from
'Scumm::InstrumentInternal*' to 'int' loses precision
./sound/mididrv.h: At global scope:
./sound/mididrv.h:159: warning: 'class MidiChannel'
only defines private constructors and has no friends
./sound/mididrv.h:159: warning: 'class MidiChannel' has
virtual functions but non-virtual destructor
./common/str.h:104: warning: 'class Common::StringList'
only defines private constructors and has no friends
./common/stream.h:34: warning: 'class
Common::WriteStream' only defines private constructors
and has no friends
./common/stream.h:34: warning: 'class
Common::WriteStream' has virtual functions but
non-virtual destructor
./common/stream.h:99: warning: 'class
Common::ReadStream' only defines private constructors
and has no friends
./common/stream.h:99: warning: 'class
Common::ReadStream' has virtual functions but
non-virtual destructor
./common/stream.h:175: warning: 'class
Common::SeekableReadStream' only defines private
constructors and has no friends
./common/stream.h:175: warning: 'class
Common::SeekableReadStream' has virtual functions but
non-virtual destructor
./common/stream.h:194: warning: 'class
Common::XORReadStream' has virtual functions but
non-virtual destructor
./common/stream.h:220: warning: 'class
Common::MemoryReadStream' has virtual functions but
non-virtual destructor
./common/stream.h:263: warning: 'class
Common::MemoryWriteStream' has virtual functions but
non-virtual destructor
./scumm/gfx.h:81: warning: 'struct Scumm::VirtScreen'
only defines private constructors and has no friends
./scumm/scumm.h:278: warning: 'struct Scumm::StringTab'
only defines private constructors and has no friends
./scumm/scumm.h:155: warning: 'Scumm::debugChannels'
defined but not used
make: *** [scumm/imuse.o] Error 1

The actual error is:
./scumm/instrument.h:76: error: cast from
'Scumm::InstrumentInternal*' to 'int' loses precision

Ticket imported from: #1182903. Ticket imported from: bugs/1996.

Change History (5)

comment:1 Changed 14 years ago by eriktorbjorn

So it's that strange "int" operator with the big FIXME
comment? I don't know what the purpose of that is, but
here's the commit mail for when it was added:

https://sourceforge.net/mailarchive/forum.php?thread_id=2324713&forum_id=33067

The line "return (int)part->_instrument;" is in
scumm/imuse_player.cpp these days, and I see Fingolfin has
alread put an error() there...

comment:2 Changed 14 years ago by (none)

I should add that I am trying to compile it on an AMD64 system.

And the comment says that it will not work on a 64-bit system.

comment:3 Changed 14 years ago by fingolfin

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:4 Changed 14 years ago by fingolfin

I removed that part of the code, it wasn't used, as the FIXME comment
next to it explains.

ScummVM won't properly work on 64 bit systems for other reasons. Of
course you are welcome to look into this and submit patches to fix 64 bit
issues as you encounter them, but as none of the dev team has a 64 bit
system at this time, it won't help to submit bug reports about this to us.

comment:5 Changed 10 months ago by digitall

Component: Port: Linux
Note: See TracTickets for help on using tickets.