Loggytronic Forum

VOMP => VOMP General / MVP => Topic started by: davep on October 14, 2007, 15:59:19

Title: Server compilation errors with GCC 4.2
Post by: davep on October 14, 2007, 15:59:19
I've just upgraded my server from Mandriva 2007.1 to 2008.0, which has updated the compiler to GCC 4.2.2 (pre-release). Compiling the VOMP plugin now fails with messages such as these:

tftpclient.c: In member function 'int TftpClient::openFile(char*)':
tftpclient.c:275: warning: deprecated conversion from string constant to 'char*'
tftpclient.c:275: warning: deprecated conversion from string constant to 'char*'
tftpclient.c:283: warning: deprecated conversion from string constant to 'char*'
tftpclient.c:283: warning: deprecated conversion from string constant to 'char*'

As a workaround I modified the Makefile

#CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual -Werror
CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual

which lets VOMP compile, though there are hundreds of error messages.

Dave
Title: Re: Server compilation errors with GCC 4.2
Post by: Chris on October 14, 2007, 16:20:38
Thanks for reporting that, I'll add it to the to-do list.
Title: Re: Server compilation errors with GCC 4.2
Post by: keynet on October 19, 2007, 20:51:42
Me too on SuSe 10.3,  FYI the following files:
media.c
tftpclient.c
mvpreceiver.c
log.c
config.c
recplayer.c
mvprelay.c
tcp.c
bootpd.c
udpreplier.c
dsock.c
Title: Re: Server compilation errors with GCC 4.2
Post by: davep on October 21, 2007, 13:00:07
The attached patch (against CVS) stops the compiler warnings, and I've been running it for a week with no problems.
Title: Re: Server compilation errors with GCC 4.2
Post by: Chris on October 29, 2007, 21:18:52
Hello, I have applied the patch file, thanks. Could you check it's ok now with the normal error options on the compiler line? Thanks.
Title: Re: Server compilation errors with GCC 4.2
Post by: keynet on October 30, 2007, 00:01:24
Chris,
After your patch, I re-ran cvs -z3 -d:pserver:anonymous@vomp.cvs.sourceforge.net:/cvsroot/vomp co -P vompserver to update my files,
The other files are OK, but this remains:

g++ -O2 -fPIC -Wall -Woverloaded-virtual -Werror -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"vompserver"' -I../../../in                       /include -o bootpd.o bootpd.c
cc1plus: warnings being treated as errors
bootpd.c: In member function 'void Bootpd::processRequest(UCHAR*, int)':
bootpd.c:144: warning: the address of 'newClientIP' will always evaluate as 'true'
make[1]: *** [bootpd.o] Error 1

HTH
Title: Re: Server compilation errors with GCC 4.2
Post by: Chris on November 05, 2007, 21:07:38
That last issue should be fixed now. Thanks for reporting it.