gcc compile complaints (a.k.a. gcc warnings)

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

gcc compile complaints (a.k.a. gcc warnings)

Post by Edward-san »

Hi, I've thought of creating this thread to gather all the compile warnings offered by gcc. And to say them "Get the frak off!".

This is what gcc thinks of GZDoom (revision 1172):
Release build:
Spoiler:
Debug build:
Spoiler:
To help Graf isolating the gl code warnings from zdoom, here it is the zdoom compile warnings (revision 3106):

Release build:
[spoiler]

Code: Select all

CMakeFiles/updaterevision.dir/updaterevision.o: In function `main':
updaterevision.c:(.text+0xd5): warning: the use of `tempnam' is dangerous, better use `mkstemp'
/home/edward-san/zdoom/trunk/tools/zipdir/zipdir.c: In function ‘compress_bzip2’:
/home/edward-san/zdoom/trunk/tools/zipdir/zipdir.c:1259: warning: passing argument 3 of ‘BZ2_bzBuffToBuffCompress’ discards qualifiers from pointer target type
/usr/include/bzlib.h:204: note: expected ‘char *’ but argument is of type ‘const Byte *’
/home/edward-san/zdoom/trunk/game-music-emu/gme/Dual_Resampler.cpp: In member function ‘void Dual_Resampler::play_frame_(Blip_Buffer&, short int*)’:
/home/edward-san/zdoom/trunk/game-music-emu/gme/Dual_Resampler.cpp:66: warning: unused variable ‘count’
/home/edward-san/zdoom/trunk/gdtoa/arithchk.c: In function ‘ccheck’:
/home/edward-san/zdoom/trunk/gdtoa/arithchk.c:109: warning: format not a string literal and no format arguments
src/svnrevision.h is up to date at revision 3105.
/home/edward-san/zdoom/trunk/src/sdl/crashcatcher.c: In function ‘gdb_info’:
/home/edward-san/zdoom/trunk/src/sdl/crashcatcher.c:146: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sdl/crashcatcher.c: In function ‘sys_info’:
/home/edward-san/zdoom/trunk/src/sdl/crashcatcher.c:166: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sdl/crashcatcher.c: In function ‘crash_handler’:
/home/edward-san/zdoom/trunk/src/sdl/crashcatcher.c:377: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sdl/crashcatcher.c: In function ‘cc_install_handlers’:
/home/edward-san/zdoom/trunk/src/sdl/crashcatcher.c:397: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sdl/i_system.cpp: In function ‘int I_PickIWad(WadStuff*, int, bool, int)’:
/home/edward-san/zdoom/trunk/src/sdl/i_system.cpp:682: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sdl/i_system.cpp: In function ‘unsigned int I_MakeRNGSeed()’:
/home/edward-san/zdoom/trunk/src/sdl/i_system.cpp:827: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/am_map.cpp: In function ‘void AM_changeWindowScale()’:
/home/edward-san/zdoom/trunk/src/am_map.cpp:1231: warning: ‘mtof_zoommul’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/c_cmds.cpp: In function ‘void Cmd_dir(FCommandLine&, APlayerPawn*, int)’:
/home/edward-san/zdoom/trunk/src/c_cmds.cpp:634: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/d_dehacked.cpp: In function ‘bool D_LoadDehFile(const char*)’:
/home/edward-san/zdoom/trunk/src/d_dehacked.cpp:2307: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/d_main.cpp: In function ‘void D_AddDirectory(TArray<FString, FString>&, const char*)’:
/home/edward-san/zdoom/trunk/src/d_main.cpp:1476: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/d_net.cpp: In function ‘void Net_DoCommand(int, BYTE**, int)’:
/home/edward-san/zdoom/trunk/src/d_net.cpp:2321: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/d_net.cpp:2340: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/farchive.cpp: In member function ‘void FCompressedFile::PostOpen()’:
/home/edward-san/zdoom/trunk/src/farchive.cpp:195: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/farchive.cpp:209: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/farchive.cpp:214: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/farchive.cpp: In constructor ‘FPNGChunkFile::FPNGChunkFile(FILE*, DWORD, size_t)’:
/home/edward-san/zdoom/trunk/src/farchive.cpp:574: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/farchive.cpp: In constructor ‘FPNGChunkFile::FPNGChunkFile(FILE*, DWORD, size_t)’:
/home/edward-san/zdoom/trunk/src/farchive.cpp:574: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/farchive.cpp: In constructor ‘FPNGChunkFile::FPNGChunkFile(FILE*, DWORD, size_t)’:
/home/edward-san/zdoom/trunk/src/farchive.cpp:574: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/g_game.cpp: In function ‘void G_DoLoadGame()’:
/home/edward-san/zdoom/trunk/src/g_game.cpp:1790: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/g_game.cpp:1819: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/m_misc.cpp: In function ‘void M_FindResponseFile()’:
/home/edward-san/zdoom/trunk/src/m_misc.cpp:188: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/tarray.h: In member function ‘void FNodeBuilder::CreateSubsectorsForReal()’:
/home/edward-san/zdoom/trunk/src/tarray.h:141: warning: ‘sub.subsector_t::flags’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/nodebuild.cpp:210: note: ‘sub.subsector_t::flags’ was declared here
/home/edward-san/zdoom/trunk/src/tarray.h:141: warning: ‘sub.subsector_t::render_sector’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/nodebuild.cpp:210: note: ‘sub.subsector_t::render_sector’ was declared here
/home/edward-san/zdoom/trunk/src/p_acs.cpp: In member function ‘int DLevelScript::RunScript()’:
/home/edward-san/zdoom/trunk/src/p_acs.cpp:4999: warning: unknown conversion type character ‘B’ in format
/home/edward-san/zdoom/trunk/src/p_acs.cpp:4999: warning: too many arguments for format
/home/edward-san/zdoom/trunk/src/p_acs.cpp: In member function ‘int DLevelScript::CallFunction(int, int, SDWORD*)’:
/home/edward-san/zdoom/trunk/src/p_acs.cpp:3490: warning: ‘dest’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/r_polymost.cpp: In member function ‘void PolyClipper::InitMosts(double*, double*, int)’:
/home/edward-san/zdoom/trunk/src/r_polymost.cpp:143: warning: array subscript is below array bounds
/home/edward-san/zdoom/trunk/src/r_things.cpp: In function ‘void R_InitSpriteDefs()’:
/home/edward-san/zdoom/trunk/src/r_things.cpp:482: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/r_things.cpp: In function ‘bool VOX_ReadSpriteNames(FScanner&, TArray<unsigned int, unsigned int>&)’:
/home/edward-san/zdoom/trunk/src/r_things.cpp:614: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/r_things.cpp: In function ‘void R_CheckOffscreenBuffer(int, int, bool)’:
/home/edward-san/zdoom/trunk/src/r_things.cpp:3692: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/r_things.cpp: In function ‘void R_ProjectSprite(AActor*, int)’:
/home/edward-san/zdoom/trunk/src/r_things.cpp:1697: warning: ‘xscale’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/r_things.cpp:1697: warning: ‘yscale’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/intermission/intermission_parse.cpp: In member function ‘FName FMapInfoParser::ParseEndGame()’:
/home/edward-san/zdoom/trunk/src/intermission/intermission_parse.cpp:663: warning: ‘action’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/resourcefiles/resourcefile.cpp: In member function ‘virtual int FExternalLump::FillCache()’:
/home/edward-san/zdoom/trunk/src/resourcefiles/resourcefile.cpp:429: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp: In constructor ‘CDDAFile::CDDAFile(FILE*, int)’:
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:95: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:98: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:104: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:105: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp: In constructor ‘CDDAFile::CDDAFile(FILE*, int)’:
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:95: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:98: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:104: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:105: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp: In constructor ‘CDDAFile::CDDAFile(FILE*, int)’:
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:95: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:98: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:104: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_cd.cpp:105: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/sound/music_midi_timidity.cpp: In member function ‘bool TimidityPPMIDIDevice::LaunchTimidity()’:
/home/edward-san/zdoom/trunk/src/sound/music_midi_timidity.cpp:455: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/thingdef/thingdef_codeptr.cpp: In function ‘void AFP_A_CustomBulletAttack(AActor*, AActor*, FState*, int, StateCallData*)’:
/home/edward-san/zdoom/trunk/src/thingdef/thingdef_codeptr.cpp:847: warning: ‘bslope’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/thingdef/thingdef_codeptr.cpp: In function ‘void AFP_A_FireBullets(AActor*, AActor*, FState*, int, StateCallData*)’:
/home/edward-san/zdoom/trunk/src/thingdef/thingdef_codeptr.cpp:1020: warning: ‘bslope’ may be used uninitialized in this function
/home/edward-san/zdoom/trunk/src/timidity/instrum_dls.cpp: In function ‘Timidity::RIFF_Chunk* Timidity::LoadRIFF(FILE*)’:
/home/edward-san/zdoom/trunk/src/timidity/instrum_dls.cpp:143: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
/home/edward-san/zdoom/trunk/src/timidity/instrum_dls.cpp:144: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
CMakeFiles/zdoom.dir/tempfiles.o: In function `FTempFileName::FTempFileName(char const*)':
tempfiles.cpp:(.text+0x67): warning: the use of `tempnam' is dangerous, better use `mkstemp'
[/spoiler]
Debug build:
[spoiler]

Code: Select all

CMakeFiles/updaterevision.dir/updaterevision.o: In function `main':
/home/edward-san/zdoom/trunk/tools/updaterevision/updaterevision.c:33: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/home/edward-san/zdoom/trunk/tools/zipdir/zipdir.c: In function ‘compress_bzip2’:
/home/edward-san/zdoom/trunk/tools/zipdir/zipdir.c:1259: warning: passing argument 3 of ‘BZ2_bzBuffToBuffCompress’ discards qualifiers from pointer target type
/usr/include/bzlib.h:204: note: expected ‘char *’ but argument is of type ‘const Byte *’
/home/edward-san/zdoom/trunk/gdtoa/arithchk.c: In function ‘ccheck’:
/home/edward-san/zdoom/trunk/gdtoa/arithchk.c:109: warning: format not a string literal and no format arguments
src/svnrevision.h is up to date at revision 3105.
/home/edward-san/zdoom/trunk/src/d_net.cpp: In function ‘void Net_DoCommand(int, BYTE**, int)’:
/home/edward-san/zdoom/trunk/src/d_net.cpp:2321: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/d_net.cpp:2340: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/p_acs.cpp: In member function ‘int DLevelScript::RunScript()’:
/home/edward-san/zdoom/trunk/src/p_acs.cpp:4999: warning: unknown conversion type character ‘B’ in format
/home/edward-san/zdoom/trunk/src/p_acs.cpp:4999: warning: too many arguments for format
/home/edward-san/zdoom/trunk/src/r_things.cpp: In function ‘void R_InitSpriteDefs()’:
/home/edward-san/zdoom/trunk/src/r_things.cpp:482: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/r_things.cpp: In function ‘bool VOX_ReadSpriteNames(FScanner&, TArray<unsigned int, unsigned int>&)’:
/home/edward-san/zdoom/trunk/src/r_things.cpp:614: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/trunk/src/r_things.cpp: In function ‘void R_CheckOffscreenBuffer(int, int, bool)’:
/home/edward-san/zdoom/trunk/src/r_things.cpp:3692: warning: comparison between signed and unsigned integer expressions
CMakeFiles/zdoom.dir/tempfiles.o: In function `FTempFileName':
/home/edward-san/zdoom/trunk/src/tempfiles.cpp:46: warning: the use of `tempnam' is dangerous, better use `mkstemp'
[/spoiler]

It'll be updated when there'll be new revisions. Stay tuned! :twisted:
Last edited by Edward-san on Sat Jan 15, 2011 23:02, edited 5 times in total.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Graf Zahl »

The ZDoom warnings are mostly not fixable. Some are in external libraries that won't be changed and some just are unavoidable. I fixed the one in music_hmi_midiout.cpp though.
Especially the ones in p_acs.cpp and in tempfiles.cpp can't be helped because removing them would render the code inoperable on some systems.
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Edward-san »

Here they are the new incredible warnings GCC gives out with latest svn (1408)
warns.txt
(34.74 KiB) Downloaded 115 times
In particular, the insistence of those messages:

Code: Select all

/home/edward-san/zdoom/gzdoom/trunk/src/./gl/renderer/gl_colormap.h: In member function ‘void FColormap::GetFixedColormap()’:
/home/edward-san/zdoom/gzdoom/trunk/src/./gl/renderer/gl_colormap.h:57:56: warning: enumeral and non-enumeral type in conditional expression
/home/edward-san/zdoom/gzdoom/trunk/src/./gl/shaders/gl_shader.h: In constructor ‘FShader::FShader()’:
/home/edward-san/zdoom/gzdoom/trunk/src/./gl/shaders/gl_shader.h:57:37: warning: converting to non-pointer type ‘unsigned int’ from NULL
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Graf Zahl »

I fixed gl_shader.h

The rest is overly paranoid nonsense. If GCC continues spilling out more and more warnings with each new version it won't help improving anything and only helps making perfectly legal code less readable.
And since when is comparing an integer with a value from an enum type a problem? I guess this one's owed to C99 idiocy.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Gez »

Here's good code according to GCC:

Code: Select all

	void GetFixedColormap()
	{
		Clear();
#ifdef __GNUC__
		// GCC has the stupidest warnings ever.
		// "warning: enumeral and non-enumeral type in conditional expression"
		int cmlite = CM_LITE;
		int cmdefault = CM_DEFAULT;
		colormap = gl_fixedcolormap >= cmlite? cmdefault : gl_fixedcolormap;
#else
		colormap = gl_fixedcolormap >= CM_LITE? CM_DEFAULT : gl_fixedcolormap;
#endif
	}
:P

Most of those warnings are from non-GL code, so report them over to ZDoom to see if Randy wants to bother with them.
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Edward-san »

Gez wrote:Here's good code according to GCC:

Code: Select all

	void GetFixedColormap()
	{
		Clear();
#ifdef __GNUC__
		// GCC has the stupidest warnings ever.
		// "warning: enumeral and non-enumeral type in conditional expression"
		int cmlite = CM_LITE;
		int cmdefault = CM_DEFAULT;
		colormap = gl_fixedcolormap >= cmlite? cmdefault : gl_fixedcolormap;
#else
		colormap = gl_fixedcolormap >= CM_LITE? CM_DEFAULT : gl_fixedcolormap;
#endif
	}
:P

Most of those warnings are from non-GL code, so report them over to ZDoom to see if Randy wants to bother with them.
Also this works:

Code: Select all

	void GetFixedColormap()
	{
		Clear();
#ifdef __GNUC__
		// GCC has the stupidest warnings ever.
		// "warning: enumeral and non-enumeral type in conditional expression"
		if (gl_fixedcolormap >= CM_LITE) colormap = CM_DEFAULT;
		else colormap = gl_fixedcolormap;
#else
		colormap = gl_fixedcolormap >= CM_LITE? CM_DEFAULT : gl_fixedcolormap;
#endif
	}
XD

btw, I haven't changed the gcc version when I ran it. So maybe it's fixed in gcc 4.7, who knows :P.
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Edward-san »

Graf Zahl wrote:The rest is overly paranoid nonsense.
Also these gl* warnings?

Code: Select all

/home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp: In member function ‘const FHardwareTexture* FGLTexture::BindPatch(int, int, int, int)’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:496:88: warning: converting ‘false’ to pointer type for argument 6 of ‘unsigned char* FGLTexture::CreateTexBuffer(int, int, int&, int&, bool, FTexture*, int)’
/home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp: In member function ‘void FMaterial::BindToFrameBuffer()’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:1015:53: warning: converting ‘false’ to pointer type for argument 5 of ‘const FHardwareTexture* FGLTexture::Bind(int, int, int, int, FTexture*, int)’
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_flats.cpp: In member function ‘void GLFlat::DrawSubsectorLights(subsector_t*, int)’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_flats.cpp:151:43: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_flats.cpp: In member function ‘void GLFlat::DrawSubsector(subsector_t*)’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_flats.cpp:239:22: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_skydome.cpp: In member function ‘virtual void GLSkyPortal::DrawContents()’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_skydome.cpp:542:97: warning: enumeral and non-enumeral type in conditional expression
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_portal.cpp: In static member function ‘static void GLPortal::EndFrame()’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_portal.cpp:491:39: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_portal.cpp: In static member function ‘static bool GLPortal::RenderFirstSkyPortal(int)’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_portal.cpp:532:37: warning: comparison of unsigned expression >= 0 is always true
I filtered the warning list with just gl* warnings.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Gez »

The enumeral/non-enumeral thing is still dumb. Replaced false pointers with NULL ones, and false ints with 0 ones.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Graf Zahl »

Edward-san wrote:
Graf Zahl wrote:The rest is overly paranoid nonsense.
Also these gl* warnings?

Code: Select all

/home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp: In member function ‘const FHardwareTexture* FGLTexture::BindPatch(int, int, int, int)’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:496:88: warning: converting ‘false’ to pointer type for argument 6 of ‘unsigned char* FGLTexture::CreateTexBuffer(int, int, int&, int&, bool, FTexture*, int)’
/home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp: In member function ‘void FMaterial::BindToFrameBuffer()’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:1015:53: warning: converting ‘false’ to pointer type for argument 5 of ‘const FHardwareTexture* FGLTexture::Bind(int, int, int, int, FTexture*, int)’
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_flats.cpp: In member function ‘void GLFlat::DrawSubsectorLights(subsector_t*, int)’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_flats.cpp:151:43: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_flats.cpp: In member function ‘void GLFlat::DrawSubsector(subsector_t*)’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_flats.cpp:239:22: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_skydome.cpp: In member function ‘virtual void GLSkyPortal::DrawContents()’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_skydome.cpp:542:97: warning: enumeral and non-enumeral type in conditional expression
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_portal.cpp: In static member function ‘static void GLPortal::EndFrame()’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_portal.cpp:491:39: warning: comparison between signed and unsigned integer expressions
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_portal.cpp: In static member function ‘static bool GLPortal::RenderFirstSkyPortal(int)’:
/home/edward-san/zdoom/gzdoom/trunk/src/gl/scene/gl_portal.cpp:532:37: warning: comparison of unsigned expression >= 0 is always true
I filtered the warning list with just gl* warnings.
Thanks for pointing out why this paranoid warning nonsense is counterproductive. If the valid warnings get hidden in a heap of garbage they are easily overlooked. But this seems to be something the gcc developers don't comprehend.
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: gcc compile complaints (a.k.a. gcc warnings)

Post by Edward-san »

heh, the 4.7.1 version still warns about the 'enumeral and non-enumeral type in conditional expression' in both gl_colormap.h and gl_skydome.cpp ...


apart from these, there are other warnings:

Code: Select all

+src/gl/data/gl_portaldata.cpp: In member function ‘void FCoverageBuilder::CollectNode(void*, TArray<FCoverageVertex>&)’:
+src/gl/data/gl_portaldata.cpp:226:35: warning: missing braces around initializer for ‘FCoverageVertex [2]’ [-Wmissing-braces]
+src/gl/data/gl_setup.cpp: In function ‘int MergeMapSections(int)’:
+src/gl/data/gl_setup.cpp:133:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
+src/gl/data/gl_setup.cpp:145:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
+src/gl/scene/gl_portal.cpp: In member function ‘virtual void GLPlaneMirrorPortal::DrawContents()’:
+src/gl/scene/gl_portal.cpp:793:60: warning: narrowing conversion of ‘GLPortal::PlaneMirrorMode’ from ‘int’ to ‘double’ inside { } is ill-formed in C++11 [-Wnarrowing]
Locked

Return to “GZDoom”