Game Development Community

Warning message : last one

by Philippe C · in Torque Game Engine · 03/19/2006 (3:46 am) · 9 replies

In this post www.garagegames.com/mg/forums/result.thread.php?qt=40960 I have proposed to fix all the warning messages during Torque compilation on LINUX.

It is done except for these one :

basgram.y:28:1: warning: "alloca" redefined
In file included from /usr/include/stdlib.h:606,
                 from basgram.y:6:
/usr/include/alloca.h:36:1: warning: this is the location of the previous definition
cmdgram.y:28:1: warning: "alloca" redefined
In file included from /usr/include/stdlib.h:606,
                 from cmdgram.y:6:
/usr/include/alloca.h:36:1: warning: this is the location of the previous definition
c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:466:2: warning: no newline at end of file
game/projectile.cc: In member function 'void Projectile::updateSound()':
game/projectile.cc:733: warning: taking address of temporary

Is some one can help me to fix the last one ?

:-)

#1
03/19/2006 (3:43 pm)
I'm assuming that line number are off stock torque..

mSoundHandle = alxPlay(mDataBlock->sound, &getRenderTransform(), &getP\
osition());

The pointer of the results of the getRenderTransform() and getPosition() are being passed to alxPlay.

This should solve the warning:
{
const MatrixF& renderTransform = getRenderTransform();
const Point3F& position = getPosition();
mSoundHandle = alxPlay(mDataBlock->sound, &renderTransform, &position);
}

Here is a discussion on the issues around the warning:

http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/2751c5e05c9962ef/21c3c64ad08286b4%2321c3c64ad08286b4

-Jerry
#2
03/20/2006 (9:12 am)
The warning is fixed , thanks Jerry.


The 3 last one :-)

basgram.y:28:1: warning: "alloca" redefined
In file included from /usr/include/stdlib.h:606,
                 from basgram.y:6:


/usr/include/alloca.h:36:1: warning: this is the location of the previous definition
cmdgram.y:28:1: warning: "alloca" redefined
In file included from /usr/include/stdlib.h:606,
                 from cmdgram.y:6:
/usr/include/alloca.h:36:1: warning: this is the location of the previous definition


c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:466:2: warning: no newline at end of file

When the last one is solved I will published the patch in the ressources area.
#3
03/20/2006 (7:58 pm)
Looking at the .y files

Turn

#define alloca dMalloc

into

#undef alloca
#define alloca dMalloc

The newline is simple.. Add a newline at the end of the file.

Then regenerate the .cc's from the .y's.

-Jerry
#4
03/21/2006 (1:19 pm)
I have done the update in the .y files.

But my issue id with bison++ Version 1.21.9-1.


when i generate the cc file i get the folowing messages :

>>bison++  -o cmdgram.cc -h cmdgram.h CMDgram.y
CMDgram.y:81 parser name defined to default :"parse"
conflicts:  1 shift/reduce

>>bison++  -o BASgram.cc -h basgram.h BASgram.y
BASgram.y:88 parser name defined to default :"parse"
2 rules never reduced
BASgram.y contains 1 useless nonterminal and 2 useless rules.
conflicts:  23 shift/reduce, 4 reduce/reduce

The other issue is that I don't get .h files => I let the old one and the compile is OK but I don't know if it is normal to don't get .h files ?

The compile is ok but the linking is KO , see below :

--> Linking out.GCC4.DEBUG/torqueDemo_DEBUG.bin
out.GCC4.DEBUG/console/cmdgram.obj: In function 'parse':
./console/ast.h:39: multiple definition of 'parse::parse()'
out.GCC4.DEBUG/console/BASgram.obj:./console/ast.h:39: first defined here
out.GCC4.DEBUG/console/cmdgram.obj: In function 'parse':
/usr/share/bison++/bison.cc:412: multiple definition of 'parse::parse()'
out.GCC4.DEBUG/console/BASgram.obj:/usr/share/bison++/bison.cc:415: first defined here
out.GCC4.DEBUG/console/cmdgram.obj: In function 'parse::yyparse()':
/usr/share/bison++/bison.cc:549: multiple definition of 'parse::yyparse()'
out.GCC4.DEBUG/console/BASgram.obj:/usr/share/bison++/bison.cc:549: first defined here
/usr/bin/ld: Warning: size of symbol 'parse::yyparse()' changed from 6992 in out.GCC4.DEBUG/console/BASgram.obj to 7621 in out.GCC4.DEBUG/console/cmdgram.obj
out.GCC4.DEBUG/console/BASscan.obj: In function 'Sc_ScanVar':
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\BASscan.l:227: undefined reference to 'BASlval'
out.GCC4.DEBUG/console/BASscan.obj: In function 'Sc_ScanString':
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\BASscan.l:269: undefined reference to 'BASlval'
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\BASscan.l:270: undefined reference to 'BASlval'
out.GCC4.DEBUG/console/BASscan.obj: In function 'Sc_ScanNum':
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\BASscan.l:278: undefined reference to 'BASlval'
out.GCC4.DEBUG/console/BASscan.obj: In function 'Sc_ScanHex':
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\BASscan.l:286: undefined reference to 'BASlval'
out.GCC4.DEBUG/console/BASscan.obj:/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\BASscan.l:83: more undefined references to 'BASlval' follow
out.GCC4.DEBUG/console/BASgram.obj: In function 'parse::parse()':
BASgram.cc:(.text+0x4): undefined reference to 'vtable for parse'
out.GCC4.DEBUG/console/BASgram.obj: In function 'parse::parse()':
BASgram.cc:(.text+0x14): undefined reference to 'vtable for parse'
out.GCC4.DEBUG/console/console.obj: In function 'Con::init()':
console/console.cc:235: undefined reference to 'CMDparse()'
console/console.cc:236: undefined reference to 'BASparse()'
out.GCC4.DEBUG/console/cmdgram.obj: In function 'parse::parse()':
cmdgram.cc:(.text+0x4): undefined reference to 'vtable for parse'
out.GCC4.DEBUG/console/cmdgram.obj: In function 'parse::parse()':
cmdgram.cc:(.text+0x14): undefined reference to 'vtable for parse'
out.GCC4.DEBUG/console/CMDscan.obj: In function 'Sc_ScanVar':
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:241: undefined reference to 'CMDlval'
out.GCC4.DEBUG/console/CMDscan.obj: In function 'Sc_ScanString':
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:276: undefined reference to 'CMDlval'
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:277: undefined reference to 'CMDlval'
out.GCC4.DEBUG/console/CMDscan.obj: In function 'Sc_ScanNum':
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:451: undefined reference to 'CMDlval'
out.GCC4.DEBUG/console/CMDscan.obj: In function 'Sc_ScanHex':
/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:459: undefined reference to 'CMDlval'
out.GCC4.DEBUG/console/CMDscan.obj:/home/pc/cvs/torque/engine/c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:86: more undefined references to 'CMDlval' follow
collect2: ld returned 1 exit status
make[1]: *** [out.GCC4.DEBUG/torqueDemo_DEBUG.bin] Error 1
make: *** [default] Error 2
#5
03/21/2006 (5:56 pm)
I've never regenerated them on linux just windows.
If you look at engine\console\bison.bat you will find the extra options.

These should work:

bison -o CMDgram.cc CMDgram.y --defines -p CMD
bison -o BASgram.cc BASgram.y --defines -p BAS

-Jerry
#6
03/22/2006 (12:07 pm)
Thanks jerry

I was able to generate with linux and native bison++ but I got warning messages. :(

Also I generate as you suggest from linux with wine and It works => no more warning message

I have done some tests with racing.starter and fps.starter no issues until now.



Only ONE warning message to solve now :

--> Compiling console/CMDscan.cc
c:\dev\GameEngine\torque_SVN\trunk\engine\console\CMDscan.l:466:2: warning: no newline at end of file

I add a new line in the file but always the warning message. I don't found any .y file for this program

A last advise Jerry ?

:)

Philippe C
#7
03/22/2006 (12:40 pm)
The error message gives you the hint :)

It's a .l not the .y.
.l's are flex.

Looking at my windows project file.

flex -PCMD CMDscan.l -o CMDscan.cc
flex -PBAS BASscan.l -o BASscan.cc

-Jerry
#8
03/23/2006 (10:35 am)
It works no more warning message !

the good syntax on linux is :
cd ../torque/engine/console
wine ../../bin/flex/flex.exe -PCMD -oCMDscan.cc CMDscan.l
wine ../../bin/flex/flex.exe -PBAS -oBASscan.cc BASscan.l

Now I prepare the patch in order to post in the ressources forum.

I will do also all the procedure to compile Torque on Linux.

YEEEEEEEES !

Thanks Jerry
#9
03/23/2006 (11:37 am)
It works no more warning message !

the good syntax on linux is :
cd ../torque/engine/console
wine ../../bin/flex/flex.exe -PCMD -oCMDscan.cc CMDscan.l
wine ../../bin/flex/flex.exe -PBAS -oBASscan.cc BASscan.l

Now I prepare the patch in order to post in the ressources forum.

I will do also all the procedure to compile Torque on Linux.

YEEEEEEEES !

Thanks Jerry