Closed ElonSatoshi closed 6 years ago
Think I see the problem, will try to get a fix in today.
Thank you :)
Get the latest master and try again, should be fixed.
I see a new error now :(
$ ./build.sh 4 amd64
-------------------------------------------------------
OpenBOR v3.0 Build 5083 - http://www.ChronoCrash.com
All rights reserved.
See LICENSE and README within OpenBOR root for details.
Copyright (c) 2004 - 2017 OpenBOR Team
-------------------------------------------------------
-------------------------------------------------------
Linux amd64 SDK (x86_64-pc-linux-gnu) Environment Loaded!
-------------------------------------------------------
Removing All LINUX Files...
Done!
Compiling LINUX Port: openbor.c...
Compiling LINUX Port: openborscript.c...
Compiling LINUX Port: sdl/joysticks.c...
Compiling LINUX Port: sdl/control.c...
Compiling LINUX Port: sdl/sblaster.c...
Compiling LINUX Port: sdl/timer.c...
Compiling LINUX Port: sdl/sdlport.c...
Compiling LINUX Port: sdl/video.c...
Compiling LINUX Port: sdl/videocommon.c...
Compiling LINUX Port: sdl/threads.c...
Compiling LINUX Port: sdl/menu.c...
Compiling LINUX Port: sdl/opengl.c...
Compiling LINUX Port: sdl/loadgl.c...
Compiling LINUX Port: source/adpcmlib/adpcm.c...
Compiling LINUX Port: source/gfxlib/2xSaI.c...
Compiling LINUX Port: source/gfxlib/bilinear.c...
Compiling LINUX Port: source/gfxlib/dotmatrix.c...
Compiling LINUX Port: source/gfxlib/gfx.c...
Compiling LINUX Port: source/gfxlib/hq2x.c...
Compiling LINUX Port: source/gfxlib/scale2x.c...
Compiling LINUX Port: source/gfxlib/scanline.c...
Compiling LINUX Port: source/gfxlib/simple2x.c...
Compiling LINUX Port: source/gfxlib/tv2x.c...
Compiling LINUX Port: source/gamelib/draw.c...
Compiling LINUX Port: source/gamelib/draw16.c...
Compiling LINUX Port: source/gamelib/draw32.c...
Compiling LINUX Port: source/gamelib/font.c...
Compiling LINUX Port: source/gamelib/translation.c...
Compiling LINUX Port: source/gamelib/anigif.c...
Compiling LINUX Port: source/gamelib/bitmap.c...
Compiling LINUX Port: source/gamelib/screen.c...
Compiling LINUX Port: source/gamelib/screen16.c...
Compiling LINUX Port: source/gamelib/screen32.c...
Compiling LINUX Port: source/gamelib/loadimg.c...
Compiling LINUX Port: source/gamelib/palette.c...
Compiling LINUX Port: source/gamelib/packfile.c...
Compiling LINUX Port: source/gamelib/filecache.c...
Compiling LINUX Port: source/gamelib/pixelformat.c...
Compiling LINUX Port: source/gamelib/soundmix.c...
Compiling LINUX Port: source/gamelib/spriteq.c...
Compiling LINUX Port: source/gamelib/sprite.c...
Compiling LINUX Port: source/gamelib/spritex8p16.c...
Compiling LINUX Port: source/gamelib/spritex8p32.c...
Compiling LINUX Port: source/gamelib/commands.c...
Compiling LINUX Port: source/gamelib/models.c...
Compiling LINUX Port: source/gamelib/transform.c...
Compiling LINUX Port: source/gamelib/filters.c...
Compiling LINUX Port: source/stringptr.c...
Compiling LINUX Port: source/utils.c...
Compiling LINUX Port: source/stristr.c...
Compiling LINUX Port: source/omath.c...
Compiling LINUX Port: source/scriptlib/StackedSymbolTable.c...
Compiling LINUX Port: source/scriptlib/ScriptVariant.c...
Compiling LINUX Port: source/scriptlib/SymbolTable.c...
Compiling LINUX Port: source/scriptlib/Instruction.c...
Compiling LINUX Port: source/scriptlib/Interpreter.c...
Compiling LINUX Port: source/scriptlib/ImportCache.c...
Compiling LINUX Port: source/scriptlib/ParserSet.c...
Compiling LINUX Port: source/scriptlib/Parser.c...
Compiling LINUX Port: source/scriptlib/Lexer.c...
Compiling LINUX Port: source/scriptlib/Stack.c...
Compiling LINUX Port: source/scriptlib/List.c...
source/scriptlib/Parser.c: In function ‘Parser_Unary_expr’:
source/scriptlib/Parser.c:1807:30: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
sprintf(buf, "-%s", pInstruction->theToken->theSource);
^
source/scriptlib/Parser.c:1807:13: note: ‘sprintf’ output between 2 and 129 bytes into a destination of size 128
sprintf(buf, "-%s", pInstruction->theToken->theSource);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source/scriptlib/Parser.c:1834:30: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
sprintf(buf, "!%s", pInstruction->theToken->theSource);
^
source/scriptlib/Parser.c:1834:13: note: ‘sprintf’ output between 2 and 129 bytes into a destination of size 128
sprintf(buf, "!%s", pInstruction->theToken->theSource);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling LINUX Port: source/preprocessorlib/pp_lexer.c...
cc1: all warnings being treated as errors
make: *** [Makefile:658: source/scriptlib/Parser.o] Error 1
make: *** Waiting for unfinished jobs....
Removing All LINUX Files...
Done!
The problem this time is the Linux compiler is stupid. That code has been in place for at least three years and never caused any problems before. I'll see what I can do though.
All right. Try latest. It's a kludge fix, but I want to see if my hunch is right.
instead of trying to add kludge fixes, i'd suggest using git bisect
to find the commit that introduced the error, so one can properly reason how the bug came into existence to begin with and can develop an adequate fix or revert the bad commit.
In this case, it doesn't look like any commit introduced the error -- it's just a new warning on old code introduced by a new compiler version, which turns into an error because we compile with -Werror. It happens every once in a while.
I keep getting this error when compiling:
I've tried different versions of gcc, from 7.3.0 to 7.3.1+20180406. I still get this error. My OS is Parabola Linux. What do I do? What other information do I need to specify?