Anonymous | Login | Signup for a new account | 2024-03-29 12:08 UTC |
My View | View Issues | Change Log | Roadmap | Zandronum Issue Support Ranking | Rules | My Account |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0001974 | Zandronum | [All Projects] Bug | public | 2014-10-27 10:23 | 2020-05-05 22:05 | ||||
Reporter | Edward-san | ||||||||
Assigned To | |||||||||
Priority | normal | Severity | tweak | Reproducibility | always | ||||
Status | closed | Resolution | invalid | ||||||
Platform | OS | OS Version | |||||||
Product Version | 1.3 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0001974: Collection of various compiler warnings | ||||||||
Description | This ticket is intended to post all the warnings GCC, Clang, MSVC, etc are found, while ignoring the GZDoom codebase ones. To filter them, the only way I know is to compile gzdoom r900 (from this git repository:'https://github.com/doomtech/gzdoom [^]' ) in Release mode and save the warnings to a file; then compile zandronum 2.0 beta in Release mode and save the warnings to a file; compare them and remove the common warnings from both files. There's a problem while compiling gzdoom r900 in non-Windows targets and it can be fixed with the attached patch compile-gzdoom900-linux.diff.txt (it's available only for linux targets for now). I suggest to avoid using the old gzdoom r323 as codebase, because it doesn't compile with linux and requires some workarounds. Currently, it's not possible to compile gzdoom and zandronum with clang, because its support in gzdoom was added a lot later. It's possible to post non-default warnings, if they make sense. | ||||||||
Attached Files | compile-gzdoom900-linux.diff.txt [^] (1,070 bytes) 2014-10-27 10:30 [Show Content] [Hide Content]diff --git a/src/gl/system/gl_interface.h b/src/gl/system/gl_interface.h index 931779c..ce33e38 100644 --- a/src/gl/system/gl_interface.h +++ b/src/gl/system/gl_interface.h @@ -1,6 +1,20 @@ #ifndef R_RENDER #define R_RENDER +// [AL] OpenGL on OS X +#ifdef __APPLE__ +#define APIENTRY +#define APIENTRYP * +#endif // __APPLE__ +// [AL] + +#ifndef PFNGLMULTITEXCOORD2FPROC +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +#endif +#ifndef PFNGLMULTITEXCOORD2FVPROC +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +#endif + enum RenderFlags { RFL_NPOT_TEXTURE=1, diff --git a/src/sdl/crashcatcher.c b/src/sdl/crashcatcher.c index 7dc9284..eafc7ce 100644 --- a/src/sdl/crashcatcher.c +++ b/src/sdl/crashcatcher.c @@ -188,9 +188,6 @@ static void crash_catcher(int signum, siginfo_t *siginfo, void *context) const char *sigdesc = NULL; pid_t pid, dbg_pid; struct stat sbuf; -#ifndef __FreeBSD__ - struct rlimit rl; -#endif int status, i; FILE *f; zandronum_2.x_warns_gcc.txt [^] (18,478 bytes) 2014-10-27 13:02 [Show Content] [Hide Content] src/callvote.cpp: In function ‘void CALLVOTE_Tick()’: src/callvote.cpp:165:125: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘LONG {aka long int}’ [-Wformat=] g_VoteCommand.Format( "kickfromgame_idx %d \"Vote forcespec", SERVER_FindClientByAddress ( g_KickVoteVictimAddress ) ); ^ src/cl_commands.cpp: In function ‘void CLIENTCOMMANDS_Puke(LONG, int*)’: src/cl_commands.cpp:567:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for ( ULONG ulIdx = 0; ulIdx < argn; ++ulIdx ) ^ src/cl_main.cpp: In function ‘void client_SetPlayerUserInfo(BYTESTREAM_s*)’: src/cl_main.cpp:4798:56: warning: ‘ulConnectionType’ may be used uninitialized in this function [-Wmaybe-uninitialized] pPlayer->userinfo.ulConnectionType = ulConnectionType; ^ src/invasion.cpp: In member function ‘virtual void ABaseMonsterInvasionSpot::Serialize(FArchive&)’: src/invasion.cpp:218:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)lNextSpawnTick << (DWORD &)lNumLeftThisWave; ^ src/invasion.cpp:218:45: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)lNextSpawnTick << (DWORD &)lNumLeftThisWave; ^ src/invasion.cpp: In member function ‘virtual void ABasePickupInvasionSpot::Serialize(FArchive&)’: src/invasion.cpp:388:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)lNextSpawnTick << (DWORD &)lNumLeftThisWave; ^ src/invasion.cpp:388:45: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)lNextSpawnTick << (DWORD &)lNumLeftThisWave; ^ src/invasion.cpp: In member function ‘virtual void ABaseWeaponInvasionSpot::Serialize(FArchive&)’: src/invasion.cpp:557:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)lNextSpawnTick; ^ src/invasion.cpp: In function ‘void INVASION_WriteSaveInfo(FILE*)’: src/invasion.cpp:1368:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1368:50: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1368:89: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1368:117: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1368:145: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1368:178: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp: In function ‘void INVASION_ReadSaveInfo(PNGHandle*)’: src/invasion.cpp:1383:19: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1383:51: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1383:90: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1383:118: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1383:146: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/invasion.cpp:1383:179: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft; ^ src/network.cpp: In function ‘NETADDRESS_s NETWORK_GetLocalAddress()’: src/network.cpp:56:67: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] #define inaddrr(x) (*(struct in_addr *) &ifr->x[sizeof sa.sin_port]) ^ src/network.cpp:831:47: note: in expansion of macro ‘inaddrr’ Printf(" with IP address: %s\n", inet_ntoa(inaddrr(ifr_addr.sa_data))); ^ src/network.cpp:831:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] Printf(" with IP address: %s\n", inet_ntoa(inaddrr(ifr_addr.sa_data))); ^ src/network.cpp:832:21: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] *(int *)&Address.abIP = *(int *)&inaddrr(ifr_addr.sa_data); ^ src/network.cpp:56:67: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] #define inaddrr(x) (*(struct in_addr *) &ifr->x[sizeof sa.sin_port]) ^ src/network.cpp:832:37: note: in expansion of macro ‘inaddrr’ *(int *)&Address.abIP = *(int *)&inaddrr(ifr_addr.sa_data); ^ src/network.cpp:56:68: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] #define inaddrr(x) (*(struct in_addr *) &ifr->x[sizeof sa.sin_port]) ^ src/network.cpp:832:37: note: in expansion of macro ‘inaddrr’ *(int *)&Address.abIP = *(int *)&inaddrr(ifr_addr.sa_data); ^ src/networkshared.cpp: In function ‘void NETWORK_SocketAddressToNetAddress(sockaddr_in*, NETADDRESS_s*)’: src/networkshared.cpp:424:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] *(int *)&a->abIP = *(int *)&s->sin_addr; ^ src/networkshared.cpp: In function ‘void NETWORK_NetAddressToSocketAddress(NETADDRESS_s&, sockaddr_in&)’: src/networkshared.cpp:436:53: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] *(int *)&SocketAddress.sin_addr = *(int *)&Address.abIP; ^ src/network/srp.cpp: In function ‘void init_random()’: src/network/srp.cpp:439:45: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(buff, sizeof(buff), 1, fp); ^ src/network/sv_auth.cpp: In function ‘int SERVER_FindClientWithClientSessionID(int)’: src/network/sv_auth.cpp:195:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if ( SERVER_GetClient(i)->clientSessionID == ClientSessionID ) ^ src/p_acs.cpp:9132:70: warning: operation on ‘sp’ may be undefined [-Wsequence-point] PushToStack(GlobalACSStrings.AddString(strbin1(work), Stack, sp)); ^ src/p_acs.cpp: In member function ‘int DLevelScript::RunScript()’: src/p_acs.cpp:7600:157: warning: array subscript is above array bounds [-Warray-bounds] SERVERCOMMANDS_SoundPoint( activationline->frontsector->soundorg[0], activationline->frontsector->soundorg[1], activationline->frontsector->soundorg[2], CHAN_AUTO, (char *)lookup, (float)(STACK(1)) / 127.f, ATTN_NORM ); ^ src/p_ceiling.cpp: In member function ‘virtual void DCeiling::Serialize(FArchive&)’: src/p_ceiling.cpp:64:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)m_lCeilingID; ^ src/p_doors.cpp: In member function ‘virtual void DDoor::Serialize(FArchive&)’: src/p_doors.cpp:61:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)m_lDoorID; ^ src/p_floor.cpp: In member function ‘virtual void DFloor::Serialize(FArchive&)’: src/p_floor.cpp:92:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)m_lFloorID; ^ src/p_floor.cpp: In member function ‘virtual void DElevator::Serialize(FArchive&)’: src/p_floor.cpp:1207:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)m_lElevatorID; ^ src/p_floor.cpp: In member function ‘virtual void DWaggleBase::Serialize(FArchive&)’: src/p_floor.cpp:1553:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)m_lWaggleID; ^ src/p_mobj.cpp: In member function ‘virtual void AActor::Serialize(FArchive&)’: src/p_mobj.cpp:349:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)ulLimitedToTeam // [BB] ^ src/p_mobj.cpp:350:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)ulVisibleToTeam // [BB] ^ src/p_mobj.cpp:351:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)lFixedColormap // [BB] ^ src/p_mobj.cpp:352:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)lNetID // [BC] We need to archive this so that it's restored properly when going between maps in a hub. ^ src/p_mobj.cpp:353:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)ulSTFlags ^ src/p_mobj.cpp:354:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)ulNetworkFlags ^ src/p_mobj.cpp:355:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)ulInvasionWave ^ src/p_mobj.cpp: In static member function ‘static void AActor::ClearTIDHashes()’: src/p_mobj.cpp:3429:39: warning: passing NULL to non-pointer argument 2 of ‘void* memset(void*, int, size_t)’ [-Wconversion-null] memset(TIDHash, NULL, sizeof(TIDHash)); ^ src/p_pillar.cpp: In member function ‘virtual void DPillar::Serialize(FArchive&)’: src/p_pillar.cpp:93:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)m_lPillarID; ^ src/p_plats.cpp: In member function ‘virtual void DPlat::Serialize(FArchive&)’: src/p_plats.cpp:59:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)m_lPlatID; ^ src/p_saveg.cpp: In function ‘void P_SerializeWorld(FArchive&)’: src/p_saveg.cpp:440:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)li->ulTexChangeFlags ^ src/p_user.cpp: In member function ‘void player_t::Serialize(FArchive&)’: src/p_user.cpp:3795:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)ulTeam ^ src/p_user.cpp:3798:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)ulRailgunShots ^ src/p_user.cpp:3799:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] << (DWORD &)lMaxHealthBonus ^ src/sv_commands.cpp: In member function ‘void NetCommand::addFloat(float)’: src/sv_commands.cpp:204:73: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] addInteger<SDWORD> ( *(reinterpret_cast<const SDWORD*> ( &FloatValue )) ); ^ src/g_doom/a_doomartifacts.cpp: In member function ‘virtual void ARandomPowerup::Serialize(FArchive&)’: src/g_doom/a_doomartifacts.cpp:171:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)ulCurrentFrame << (DWORD &)ulPowerupFlags; ^ src/g_doom/a_doomartifacts.cpp:171:45: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << (DWORD &)ulCurrentFrame << (DWORD &)ulPowerupFlags; ^ src/g_raven/a_artitele.cpp: In member function ‘virtual bool AArtiTeleport::Use(bool)’: src/g_raven/a_artitele.cpp:87:74: warning: ‘destAngle’ may be used uninitialized in this function [-Wmaybe-uninitialized] P_Teleport (Owner, destX, destY, ONFLOORZ, destAngle, true, true, false); ^ src/g_raven/a_artitele.cpp:87:74: warning: ‘destY’ may be used uninitialized in this function [-Wmaybe-uninitialized] src/g_raven/a_artitele.cpp:87:74: warning: ‘destX’ may be used uninitialized in this function [-Wmaybe-uninitialized] src/g_shared/a_movingcamera.cpp: In member function ‘virtual void APathFollower::Serialize(FArchive&)’: src/g_shared/a_movingcamera.cpp:203:80: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << bPostBeginPlayCalled << bActivateCalledBeforePostBeginPlay << (DWORD &)lServerPrevNodeId << (DWORD &)lServerCurrNodeId << fServerTime; ^ src/g_shared/a_movingcamera.cpp:203:110: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arc << bPostBeginPlayCalled << bActivateCalledBeforePostBeginPlay << (DWORD &)lServerPrevNodeId << (DWORD &)lServerCurrNodeId << fServerTime; ^ src/g_shared/shared_sbar.cpp: In member function ‘void DBaseStatusBar::DrawLog()’: src/g_shared/shared_sbar.cpp:1387:8: warning: case label value exceeds maximum value for type case 2: ^ zandronum_2.x_warns_gcc_castqual.txt [^] (23,725 bytes) 2014-10-27 23:29 [Show Content] [Hide Content] src/g_game.cpp: In function ‘void Cmd_slot(FCommandLine&, APlayerPawn*, int)’: src/g_game.cpp:353:60: warning: cast from type ‘const AInventory*’ to type ‘AInventory*’ casts away qualifiers [-Wcast-qual] players[consoleplayer].mo->UseInventory( (AInventory *)SendItemUse ); ^ src/m_options.cpp: In function ‘int browsermenu_PingCompareFunc(const void*, const void*)’: src/m_options.cpp:2709:36: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if (( M_ShouldShowServer( *(int *)arg1 ) == false ) && ( M_ShouldShowServer( *(int *)arg2 ) == false )) ^ src/m_options.cpp:2709:87: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if (( M_ShouldShowServer( *(int *)arg1 ) == false ) && ( M_ShouldShowServer( *(int *)arg2 ) == false )) ^ src/m_options.cpp:2712:35: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if ( M_ShouldShowServer( *(int *)arg1 ) == false ) ^ src/m_options.cpp:2715:35: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if ( M_ShouldShowServer( *(int *)arg2 ) == false ) ^ src/m_options.cpp:2718:36: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( BROWSER_GetPing( *(int *)arg1 ) - BROWSER_GetPing( *(int *)arg2 )); ^ src/m_options.cpp:2718:70: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( BROWSER_GetPing( *(int *)arg1 ) - BROWSER_GetPing( *(int *)arg2 )); ^ src/m_options.cpp: In function ‘int browsermenu_ServerNameCompareFunc(const void*, const void*)’: src/m_options.cpp:2725:36: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if (( M_ShouldShowServer( *(int *)arg1 ) == false ) && ( M_ShouldShowServer( *(int *)arg2 ) == false )) ^ src/m_options.cpp:2725:87: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if (( M_ShouldShowServer( *(int *)arg1 ) == false ) && ( M_ShouldShowServer( *(int *)arg2 ) == false )) ^ src/m_options.cpp:2728:35: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if ( M_ShouldShowServer( *(int *)arg1 ) == false ) ^ src/m_options.cpp:2731:35: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if ( M_ShouldShowServer( *(int *)arg2 ) == false ) ^ src/m_options.cpp:2734:49: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( stricmp( BROWSER_GetHostName( *(int *)arg1 ), BROWSER_GetHostName( *(int *)arg2 ))); ^ src/m_options.cpp:2734:86: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( stricmp( BROWSER_GetHostName( *(int *)arg1 ), BROWSER_GetHostName( *(int *)arg2 ))); ^ src/m_options.cpp: In function ‘int browsermenu_MapNameCompareFunc(const void*, const void*)’: src/m_options.cpp:2741:36: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if (( M_ShouldShowServer( *(int *)arg1 ) == false ) && ( M_ShouldShowServer( *(int *)arg2 ) == false )) ^ src/m_options.cpp:2741:87: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if (( M_ShouldShowServer( *(int *)arg1 ) == false ) && ( M_ShouldShowServer( *(int *)arg2 ) == false )) ^ src/m_options.cpp:2744:35: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if ( M_ShouldShowServer( *(int *)arg1 ) == false ) ^ src/m_options.cpp:2747:35: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if ( M_ShouldShowServer( *(int *)arg2 ) == false ) ^ src/m_options.cpp:2750:48: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( stricmp( BROWSER_GetMapname( *(int *)arg1 ), BROWSER_GetMapname( *(int *)arg2 ))); ^ src/m_options.cpp:2750:84: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( stricmp( BROWSER_GetMapname( *(int *)arg1 ), BROWSER_GetMapname( *(int *)arg2 ))); ^ src/m_options.cpp: In function ‘int browsermenu_PlayersCompareFunc(const void*, const void*)’: src/m_options.cpp:2757:36: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if (( M_ShouldShowServer( *(int *)arg1 ) == false ) && ( M_ShouldShowServer( *(int *)arg2 ) == false )) ^ src/m_options.cpp:2757:87: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if (( M_ShouldShowServer( *(int *)arg1 ) == false ) && ( M_ShouldShowServer( *(int *)arg2 ) == false )) ^ src/m_options.cpp:2760:35: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if ( M_ShouldShowServer( *(int *)arg1 ) == false ) ^ src/m_options.cpp:2763:35: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] if ( M_ShouldShowServer( *(int *)arg2 ) == false ) ^ src/m_options.cpp:2766:42: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( BROWSER_GetNumPlayers( *(int *)arg2 ) - BROWSER_GetNumPlayers( *(int *)arg1 )); ^ src/m_options.cpp:2766:82: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( BROWSER_GetNumPlayers( *(int *)arg2 ) - BROWSER_GetNumPlayers( *(int *)arg1 )); ^ src/m_options.cpp: In function ‘void M_StartSkirmishGame()’: src/m_options.cpp:3466:62: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] BOTSPAWN_AddToTable( szBuffer, (char *)TEAM_GetName( 3 )); ^ src/m_options.cpp:3471:62: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] BOTSPAWN_AddToTable( szBuffer, (char *)TEAM_GetName( 2 ) ); ^ src/m_options.cpp:3476:62: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] BOTSPAWN_AddToTable( szBuffer, (char *)TEAM_GetName( 1 ) ); ^ src/m_options.cpp:3480:61: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] BOTSPAWN_AddToTable( szBuffer, (char *)TEAM_GetName( 0 ) ); ^ src/network/srp.cpp: In function ‘void srp_create_salted_verification_key(SRP_HashAlgorithm, SRP_NGType, const char*, const unsigned char*, int, const unsigned char**, int*, const unsigned char**, int*, const char*, const char*)’: src/network/srp.cpp:499:37: warning: cast from type ‘const unsigned char*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual] BN_bn2bin(s, (unsigned char *) *bytes_s); ^ src/network/srp.cpp:500:37: warning: cast from type ‘const unsigned char*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual] BN_bn2bin(v, (unsigned char *) *bytes_v); ^ src/network/srp.cpp: In function ‘SRPVerifier* srp_verifier_new(SRP_HashAlgorithm, SRP_NGType, const char*, const unsigned char*, int, const unsigned char*, int, const unsigned char*, int, const unsigned char**, int*, const char*, const char*, int)’: src/network/srp.cpp:561:25: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] memcpy( (char*)ver->username, username, ulen ); ^ src/network/srp.cpp:611:30: warning: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] free( (void*) ver->username ); ^ src/network/srp.cpp:618:41: warning: cast from type ‘const unsigned char*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual] BN_bn2bin( B, (unsigned char *) *bytes_B ); ^ src/network/srp.cpp: In function ‘void srp_verifier_delete(SRPVerifier*)’: src/network/srp.cpp:644:27: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] free( (char *) ver->username ); ^ src/network/srp.cpp:645:36: warning: cast from type ‘const unsigned char*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual] free( (unsigned char *) ver->bytes_B ); ^ src/network/srp.cpp: In function ‘SRPUser* srp_user_new(SRP_HashAlgorithm, SRP_NGType, const char*, const unsigned char*, int, const char*, const char*, int)’: src/network/srp.cpp:715:25: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] memcpy((char *)usr->username, username, ulen); ^ src/network/srp.cpp:716:25: warning: cast from type ‘const unsigned char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] memcpy((char *)usr->password, bytes_password, len_password); ^ src/network/srp.cpp:732:28: warning: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] free((void*)usr->username); ^ src/network/srp.cpp:735:30: warning: cast from type ‘const unsigned char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] memset((void*)usr->password, 0, usr->password_len); ^ src/network/srp.cpp:736:28: warning: cast from type ‘const unsigned char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] free((void*)usr->password); ^ src/network/srp.cpp: In function ‘void srp_user_delete(SRPUser*)’: src/network/srp.cpp:753:26: warning: cast from type ‘const unsigned char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] memset((void*)usr->password, 0, usr->password_len); ^ src/network/srp.cpp:754:25: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] free((char *)usr->username); ^ src/network/srp.cpp:755:25: warning: cast from type ‘const unsigned char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] free((char *)usr->password); ^ src/network/srp.cpp:757:29: warning: cast from type ‘const unsigned char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] free( (char *)usr->bytes_A ); ^ src/network/srp.cpp: In function ‘void srp_user_start_authentication(SRPUser*, const char**, const unsigned char**, int*)’: src/network/srp.cpp:806:43: warning: cast from type ‘const unsigned char*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual] BN_bn2bin( usr->A, (unsigned char *) *bytes_A ); ^ src/network/srp.cpp: In function ‘void init_random()’: src/network/srp.cpp:439:45: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(buff, sizeof(buff), 1, fp); ^ src/p_acs.cpp: In static member function ‘static int FBehavior::SortScripts(const void*, const void*)’: src/p_acs.cpp:2514:33: warning: cast from type ‘const void*’ to type ‘ScriptPtr*’ casts away qualifiers [-Wcast-qual] ScriptPtr *ptr1 = (ScriptPtr *)a; ^ src/p_acs.cpp:2515:33: warning: cast from type ‘const void*’ to type ‘ScriptPtr*’ casts away qualifiers [-Wcast-qual] ScriptPtr *ptr2 = (ScriptPtr *)b; src/p_acs.cpp:7569:42: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_SetMapMusic( (char *)lookup ); ^ src/p_acs.cpp:7600:179: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_SoundPoint( activationline->frontsector->soundorg[0], activationline->frontsector->soundorg[1], activationline->frontsector->soundorg[2], CHAN_AUTO, (char *)lookup, (float)(STACK(1)) / 127.f, ATTN_NORM ); ^ src/p_acs.cpp:7612:48: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_Sound( CHAN_AUTO, (char *)lookup, (float)( STACK( 1 ) / 127.f ), ATTN_NORM ); ^ src/p_acs.cpp:7628:47: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_Sound( CHAN_AUTO, (char *)lookup, (float)( STACK( 1 ) / 127.f ), ATTN_NONE ); ^ src/p_acs.cpp:7647:47: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_Sound( CHAN_AUTO, (char *)lookup, (float)( STACK( 1 ) / 127.f ), ATTN_NONE, activator->player - players, SVCF_ONLYTHISCLIENT ); ^ src/p_acs.cpp:7843:59: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_SoundActor( spot, CHAN_AUTO, (char *)lookup, (float)STACK( 1 ) / 127.f, ATTN_NORM ); ^ src/p_acs.cpp:8130:82: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_SetMapMusic( (char *)FBehavior::StaticLookupString( STACK( 3 ))); ^ src/p_acs.cpp:8131:74: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVER_SetMapMusic( (char *)FBehavior::StaticLookupString( STACK( 3 ))); ^ src/p_acs.cpp:8143:87: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_SetMapMusic( (char *)FBehavior::StaticLookupString( uallong(pc[0]) )); ^ src/p_acs.cpp:8144:79: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVER_SetMapMusic( (char *)FBehavior::StaticLookupString( uallong(pc[0]) )); ^ src/p_acs.cpp:8157:83: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_SetMapMusic( (char *)FBehavior::StaticLookupString( STACK( 3 )), activator->player - players, SVCF_ONLYTHISCLIENT ); ^ src/p_acs.cpp:8173:79: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_SetMapMusic( (char *)FBehavior::StaticLookupString( pc[0] ), activator->player - players, SVCF_ONLYTHISCLIENT ); ^ src/p_acs.cpp:8755:59: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] SERVERCOMMANDS_SetCameraToTexture( camera, (char *)picname, STACK( 1 )); ^ src/scoreboard.cpp: In function ‘int scoreboard_FragCompareFunc(const void*, const void*)’: src/scoreboard.cpp:2129:27: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( players[*(int *)arg2].fragcount - players[*(int *)arg1].fragcount ); ^ src/scoreboard.cpp:2129:61: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( players[*(int *)arg2].fragcount - players[*(int *)arg1].fragcount ); ^ src/scoreboard.cpp: In function ‘int scoreboard_PointsCompareFunc(const void*, const void*)’: src/scoreboard.cpp:2136:27: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( players[*(int *)arg2].lPointCount - players[*(int *)arg1].lPointCount ); ^ src/scoreboard.cpp:2136:63: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( players[*(int *)arg2].lPointCount - players[*(int *)arg1].lPointCount ); ^ src/scoreboard.cpp: In function ‘int scoreboard_KillsCompareFunc(const void*, const void*)’: src/scoreboard.cpp:2143:27: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( players[*(int *)arg2].killcount - players[*(int *)arg1].killcount ); ^ src/scoreboard.cpp:2143:61: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( players[*(int *)arg2].killcount - players[*(int *)arg1].killcount ); ^ src/scoreboard.cpp: In function ‘int scoreboard_WinsCompareFunc(const void*, const void*)’: src/scoreboard.cpp:2150:27: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( players[*(int *)arg2].ulWins - players[*(int *)arg1].ulWins ); ^ src/scoreboard.cpp:2150:58: warning: cast from type ‘const void*’ to type ‘int*’ casts away qualifiers [-Wcast-qual] return ( players[*(int *)arg2].ulWins - players[*(int *)arg1].ulWins ); ^ src/g_shared/pwo.cpp: In function ‘int PWO_CompareWeight(const void*, const void*)’: src/g_shared/pwo.cpp:99:32: warning: cast from type ‘const void*’ to type ‘PWODef*’ casts away qualifiers [-Wcast-qual] const PWODef* def1 = (PWODef*)elem1; ^ src/g_shared/pwo.cpp:100:32: warning: cast from type ‘const void*’ to type ‘PWODef*’ casts away qualifiers [-Wcast-qual] const PWODef* def2 = (PWODef*)elem2; ^ src/g_shared/pwo.cpp: In function ‘int PWO_CompareWeight2(const void*, const void*)’: src/g_shared/pwo.cpp:113:34: warning: cast from type ‘const void*’ to type ‘PWODef**’ casts away qualifiers [-Wcast-qual] const PWODef* def1 = *(PWODef**)elem1; ^ src/g_shared/pwo.cpp:114:34: warning: cast from type ‘const void*’ to type ‘PWODef**’ casts away qualifiers [-Wcast-qual] const PWODef* def2 = *(PWODef**)elem2; ^ upnpnat/xmlParser.cpp: In function ‘char* _tcsstr(const char*, const char*)’: upnpnat/xmlParser.cpp:23:75: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] char *_tcsstr(const char *c1, const char *c2) { return (char*)strstr(c1,c2); } ^ upnpnat/xmlParser.cpp: In function ‘char* _tcschr(const char*, int)’: upnpnat/xmlParser.cpp:24:67: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] char *_tcschr(const char *c1, int c2) { return (char*)strchr(c1,c2); } ^ upnpnat/xmlParser.cpp: In function ‘char* fromXMLString(const char*, int)’: upnpnat/xmlParser.cpp:201:20: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] return (LPTSTR)s; ^ upnpnat/xmlParser.cpp: In static member function ‘static void* XMLNode::enumContent(XMLNode::XMLNodeData*, int, XMLElementType*)’: upnpnat/xmlParser.cpp:1345:58: warning: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] case eNodeText: return (void*)(pEntry->pText[i]); ^ upnpnat/xmlParser.cpp: In static member function ‘static void XMLNode::destroyCurrentBuffer(XMLNode::XMLNodeData*)’: upnpnat/xmlParser.cpp:1675:57: warning: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] for(i=0; i<d->nText; i++) free((void*)d->pText[i]); ^ upnpnat/xmlParser.cpp:1677:61: warning: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] for(i=0; i<d->nClear; i++) free((void*)d->pClear[i].lpszValue); ^ upnpnat/xmlParser.cpp:1681:42: warning: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] free((void*)d->pAttribute[i].lpszName); ^ upnpnat/xmlParser.cpp:1682:74: warning: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] if (d->pAttribute[i].lpszValue) free((void*)d->pAttribute[i].lpszValue); ^ upnpnat/xmlParser.cpp:1686:24: warning: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers [-Wcast-qual] free((void*)d->lpszName); ^ | ||||||||
Notes | |
(0010704) Edward-san (developer) 2014-10-27 13:15 edited on: 2014-10-27 23:40 |
Attached what I get myself with gcc 4.9.1 on ubuntu linux x86_64. All the reported -Wmaybe-uninitialized warnings are false positives (the one in cl_main.cpp is idiocy, the ones in g_raven/a_artitele.cpp are because the function I_Error (I_FatalError, too) does not have the 'noreturn' attribute). [edit]Added also what I get if I add -Wcast-qual to the compiler options. |
(0021314) Edward-san (developer) 2020-05-05 22:05 |
This can be closed. Some of these warnings were fixed over the course of time. It lost its momentum, given that the mentioned warnings rarely refer to 'broken code', so it's fine as is. |
This issue is already marked as resolved. If you feel that is not the case, please reopen it and explain why. |
|
Supporters: | No one explicitly supports this issue yet. |
Opponents: | No one explicitly opposes this issue yet. |
Issue History | |||
Date Modified | Username | Field | Change |
2014-10-27 10:23 | Edward-san | New Issue | |
2014-10-27 10:23 | Edward-san | Status | new => assigned |
2014-10-27 10:23 | Edward-san | Assigned To | => Edward-san |
2014-10-27 10:30 | Edward-san | Description Updated | View Revisions |
2014-10-27 10:30 | Edward-san | File Added: compile-gzdoom900-linux.diff.txt | |
2014-10-27 10:31 | Edward-san | Description Updated | View Revisions |
2014-10-27 13:02 | Edward-san | File Added: zandronum_2.x_warns_gcc.txt | |
2014-10-27 13:15 | Edward-san | Note Added: 0010704 | |
2014-10-27 23:29 | Edward-san | File Added: zandronum_2.x_warns_gcc_castqual.txt | |
2014-10-27 23:40 | Edward-san | Note Edited: 0010704 | View Revisions |
2020-05-05 22:05 | Edward-san | Note Added: 0021314 | |
2020-05-05 22:05 | Edward-san | Status | assigned => closed |
2020-05-05 22:05 | Edward-san | Assigned To | Edward-san => |
2020-05-05 22:05 | Edward-san | Resolution | open => invalid |
Copyright © 2012-2024, Torr Samaho & Zandronum Team.
Doom and Doom II are the property of id Software.
Copyright © 2000 - 2024 MantisBT Team |