Bug #1199

Code Cleanup - possible compiler bugs too

Added by divVerent about 2 years ago. Updated about 1 year ago.

Status:NewStart date:05/02/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:0.8

Description

I attached a list of analyzer reports for our QC code.

The analyzer detects:
- unused values (unnecessary code, only slows down everything)
- use of uninitialized value (all locals should be initialized in a function, otherwise stuff can go wrong e.g. in case of recursion or even an engine change)

Not all of these errors are necessarily QC code bugs, but those that are need fixing so we can use this to spot fteqcc bugs later on.

The following functions contain such issues:

Announcer_Time
attach_sameorigin
bot_aim
bot_command_executed
bot_queuecommand
bot_setnameandstuff
carrierAnnouncer
CheatCommand
CheatImpulse
ClientCommand_reportcvar
ClientCommand_sentcvar
ClientConnect
client_hasweapon
Cmd_HUD_SetFields
CommonCommand_who
CSQCModel_CheckUpdate
CSQCModel_Draw
CSQCModel_Read
CSQCModel_Send
CSQC_Parse_TempEntity
CSQCPlayer_GlowMod_Apply
CSQCPlayer_PredictTo
CSQC_RAPTOR_HUD
CSQC_SPIDER_HUD
CSQC_UpdateView
CSQC_WAKIZASHI_HUD
Damage
DamageEffect
dialog_hudpanel_common_notoggle
Drag
DrawAmmoItem
DrawDomItem
Draw_GrapplingHook_trace_callback
Draw_Laser
DrawNumIcon_expanding
Draw_ShowNames
Draw_WaypointSprite
DropAllRunes
DropBall
DropFlag
Ent_DamageInfo
Ent_GibSplash
Ent_ReadPlayerScore
example_skel_player_update_eyetarget
fireBallisticBullet
freezetag_Freeze
func_breakable_destroy
gauntletbeam_think
getcommandkey
GiveFrags
GiveItems
havocbot_goalrating_enemyplayers
havocbot_goalrating_ons_controlpoints_attack
havocbot_goalrating_ons_generator_attack
havocbot_keyboard_movement
havocbot_movetogoal
HOOKFUNCTION_dodging_PlayerPhysics
HOOKFUNCTION_sandbox_PlayerCommand
HUD_Ammo
HUD_CenterPrint
HUD_DrawScoreboard
HUD_DrawScoreboardRankings
HUD_HealthArmor
HUD_InfoMessages
HUD_KillNotify
HUD_Main
HUD_Mod_Dom
HUD_Mod_NexBall
HUD_Mod_Race
HUD_Notify
HUD_Panel_Check_Mouse_Pos
HUD_Panel_FirstInDrawQ
HUD_Panel_Highlight
HUD_Panel_InputEvent
HUD_Physics
HUD_Powerups
HUD_Radar
HUD_Score
HUD_Score_Rankings
HUD_Weapons
ImpulseCommands
Item_RespawnCountdown
ka_DropEvent
ka_RespawnBall
kh_Key_Spawn
lgbeam_think
LocalCommand_hud
MakeRaceString
m_allocatetooltipbox
_MapInfo_Map_ApplyGametype
MapVote_DrawMapItem
MapVote_FormatMapItem
MapVote_Tick
minstagib_items
movelib_groundalign4point
movelib_move
Movetype_Physics_MatchTicrate
_Movetype_Physics_Toss
_Movetype_TestEntityPosition
MUTATOR_gamemode_freezetag
MUTATOR_gamemode_keepaway
MUTATOR_gamemode_keyhunt
MUTATOR_gamemode_nexball
Net_ReadLightningarc
Noise_Brown
pathlib_astar
pathlib_close_node
pathlib_makenode_adaptive
PlayerDamage
player_regen
PlayerScore_Sort
PlayerStats_EndMatch
PlayerTouchExplode
Porto_Draw
postMenuDraw
Projectile_DrawTrail
racer_blowup
racer_dinit
racer_fire_cannon
racer_fire_rocket
RadarMapAtPoint_Sample
raptor_blowup
raptor_bomblet_boom
raptor_dinit
raptor_fire_cannon
raptor_frame
readplayerstartcvars
sandbox_Database_Load
sandbox_ObjectPort_Load
sandbox_ObjectRemove
Seeker_Fire_Flac
Seeker_Fire_Missile
Seeker_Fire_Tag
Seeker_Flac_Explode
Seeker_Missile_Explode
Seeker_Tag_Touch
setDependent_Check
ShufflePlayerOutOfTeam
spawnfunc_item_armor_big
spawnfunc_item_armor_large
spawnfunc_item_armor_medium
spawnfunc_item_armor_small
spawnfunc_item_bullets
spawnfunc_item_cells
spawnfunc_item_fuel
spawnfunc_item_fuel_regen
spawnfunc_item_health_large
spawnfunc_item_health_medium
spawnfunc_item_health_mega
spawnfunc_item_health_small
spawnfunc_item_invincible
spawnfunc_item_jetpack
spawnfunc_item_key
spawnfunc_item_rockets
spawnfunc_item_shells
spawnfunc_item_strength
spawnfunc_target_items
spiderbot_blowup
spiderbot_frame
spiderbot_rocket_do
steerlib_beamsteer
SV_PlayerPhysics
TeleportPlayer
tracebox_antilag
tracewalk
trigger_keylock_touch
trigger_relay_if_use
turret_draw2d
turret_flac_projectile_think_explode
turret_hk_missile_think
turret_machinegun_attack
turret_projectile_explode
turret_select_target
turret_stdproc_aim_generic
turret_stdproc_init
turret_stdproc_targetscore_generic
turret_stdproc_targetscore_support
turret_stdproc_track
turret_tesla_firecheck
turret_think
unquote
uzi_mode1_fire_auto
uzi_mode1_fire_burst
vehicle_initialize
vehicles_exit
vehicles_projectile_explode
vehicles_reset_colors
vehicles_showwp
vehilces_impact
vewhicle_spiderbot_dinit
VoteCount
walker_attack
walker_postthink
walker_rocket_explode
walker_rocket_think
want_weapon
WarpZone_InitStep_UpdateTransform
WarpZone_Teleport
WarpZone_tracebox_antilag
WarpZone_TraceBox_ThroughZone
waypoint_addlink
waypoint_load_links
waypoint_load_links_hardwired
waypoint_save_links
WaypointSprite_Attach
WaypointSprite_AttachCarrier
WaypointSprite_DeployFixed
W_Crylink_Attack
W_Crylink_Attack2
W_Crylink_LinkExplode
W_Crylink_LinkJoinEffect_Think
W_Crylink_Touch
W_Crylink_Touch2
weapon_defaultspawnfunc
Weapon_KillMessage
Weapon_SuicideMessage
weapon_thinkf
w_electro
W_Electro_Attack
W_Electro_Attack2
W_Fireball_Attack1
W_Fireball_Attack2
W_Fireball_AttackEffect
W_Fireball_Explode
W_Grenade_Attack
W_Grenade_Attack2
W_Grenade_Explode
W_Grenade_Explode2
W_Hagar_Attack
W_Hagar_Attack2
W_Hagar_Attack2_Load_Release
W_Hagar_Explode
W_Hagar_Explode2
W_HLAC_Attack
W_HLAC_Attack2f
W_HLAC_Touch
W_Hook_Attack2
W_Hook_ExplodeThink
W_Laser_Attack
W_Laser_Touch
W_Mine_Attack
W_Mine_DoRemoteExplode
W_Mine_Explode
w_minelayer
W_MinstaNex_Attack
W_Nex_Attack
W_Nexball_Attack
W_Nexball_Attack2
W_Plasma_Explode
W_Plasma_Explode_Combo
w_porto
W_Porto_Attack
W_Rifle_Attack2
W_Rifle_FireBullet
w_rlauncher
W_Rocket_Attack
W_Rocket_DoRemoteExplode
W_Rocket_Explode
W_Shotgun_Attack
W_Shotgun_Attack2
w_tuba
W_Tuba_NoteOn
W_UZI_Attack
XonoticCampaignList_drawListBoxItem
XonoticCrosshairDialog_fill
XonoticCvarsDialog_fill
XonoticDemoBrowserTab_fill
XonoticEffectsSettingsTab_fill
XonoticFirstRunDialog_fill
XonoticHUDAmmoDialog_fill
XonoticHUDCenterprintDialog_fill
XonoticHUDChatDialog_fill
XonoticHUDConfirmDialog_fill
XonoticHUDDialog_fill
XonoticHUDEngineInfoDialog_fill
XonoticHUDExitDialog_fill
XonoticHUDHealthArmorDialog_fill
XonoticHUDInfoMessagesDialog_fill
XonoticHUDModIconsDialog_fill
XonoticHUDNotificationDialog_fill
XonoticHUDPhysicsDialog_fill
XonoticHUDPowerupsDialog_fill
XonoticHUDPressedKeysDialog_fill
XonoticHUDRaceTimerDialog_fill
XonoticHUDRadarDialog_fill
XonoticHUDScoreDialog_fill
XonoticHUDTimerDialog_fill
XonoticHUDVoteDialog_fill
XonoticHUDWeaponsDialog_fill
XonoticInputSettingsTab_fill
XonoticKeyBinder_drawListBoxItem
XonoticMapInfoDialog_fill
XonoticMapList_drawListBoxItem
XonoticMiscSettingsTab_fill
XonoticModelDialog_fill
XonoticMultiplayerDialog_fill
XonoticMutatorsDialog_fill
XonoticPicmipSlider_autofix
XonoticPlayerSettingsTab_fill
XonoticQuitDialog_fill
XonoticSandboxToolsDialog_fill
XonoticServerCreateTab_fill
XonoticServerInfoDialog_fill
XonoticServerInfoDialog_loadServerInfo
XonoticServerList_drawListBoxItem
XonoticServerList_setSelected
XonoticServerListTab_fill
XonoticSingleplayerDialog_fill
XonoticTeamSelectDialog_showNotify
XonoticUserbindEditDialog_fill
XonoticUserSettingsTab_fill
XonoticVideoSettingsTab_fill
XonoticViewDialog_fill
XonoticWeaponsDialog_fill
XonoticWinnerDialog_fill

The analysis reports are attached.

progs.txt Magnifier (1.31 MB) divVerent, 05/02/2012 11:22 am

menu.txt Magnifier (839 KB) divVerent, 05/02/2012 11:22 am

csprogs.txt Magnifier (2.01 MB) divVerent, 05/02/2012 11:22 am

History

#1 Updated by divVerent about 2 years ago

  • File deleted (progs.txt)

#2 Updated by divVerent about 2 years ago

  • File deleted (csprogs.txt)

#3 Updated by divVerent about 2 years ago

  • File deleted (menu.txt)

#4 Updated by divVerent about 2 years ago

Better reports attached.

#5 Updated by divVerent about 2 years ago

New function list after fixing the bug with >8 args functions:

Announcer_Time
attach_sameorigin
bot_aim
bot_command_executed
bot_queuecommand
bot_setnameandstuff
carrierAnnouncer
ClientCommand_reportcvar
ClientCommand_sentcvar
ClientConnect
Cmd_HUD_SetFields
CommonCommand_who
CSQCModel_CheckUpdate
CSQCModel_Draw
CSQCModel_Read
CSQCModel_Send
CSQC_Parse_TempEntity
CSQCPlayer_GlowMod_Apply
CSQCPlayer_PredictTo
CSQC_RAPTOR_HUD
CSQC_SPIDER_HUD
CSQC_UpdateView
CSQC_WAKIZASHI_HUD
Damage
DamageEffect
dialog_hudpanel_common_notoggle
Drag
DrawAmmoItem
DrawDomItem
Draw_GrapplingHook_trace_callback
Draw_Laser
DrawNumIcon_expanding
Draw_ShowNames
Draw_WaypointSprite
DropAllRunes
Ent_DamageInfo
Ent_GibSplash
Ent_ReadPlayerScore
example_skel_player_update_eyetarget
fireBallisticBullet
getcommandkey
GiveFrags
GiveItems
havocbot_goalrating_enemyplayers
havocbot_goalrating_ons_controlpoints_attack
havocbot_goalrating_ons_generator_attack
havocbot_keyboard_movement
havocbot_movetogoal
HOOKFUNCTION_dodging_PlayerPhysics
HOOKFUNCTION_sandbox_PlayerCommand
HUD_Ammo
HUD_CenterPrint
HUD_DrawScoreboard
HUD_DrawScoreboardRankings
HUD_HealthArmor
HUD_InfoMessages
HUD_KillNotify
HUD_Main
HUD_Mod_Dom
HUD_Mod_NexBall
HUD_Mod_Race
HUD_Notify
HUD_Panel_Check_Mouse_Pos
HUD_Panel_FirstInDrawQ
HUD_Panel_Highlight
HUD_Panel_InputEvent
HUD_Physics
HUD_Powerups
HUD_Radar
HUD_Score
HUD_Score_Rankings
HUD_Weapons
ImpulseCommands
LocalCommand_hud
MakeRaceString
m_allocatetooltipbox
_MapInfo_Map_ApplyGametype
MapVote_DrawMapItem
MapVote_FormatMapItem
MapVote_Tick
movelib_groundalign4point
movelib_move
Movetype_Physics_MatchTicrate
_Movetype_Physics_Toss
_Movetype_TestEntityPosition
MUTATOR_gamemode_freezetag
MUTATOR_gamemode_keepaway
MUTATOR_gamemode_keyhunt
MUTATOR_gamemode_nexball
Net_ReadLightningarc
Noise_Brown
pathlib_astar
pathlib_close_node
pathlib_makenode_adaptive
PlayerDamage
PlayerScore_Sort
PlayerStats_EndMatch
Porto_Draw
postMenuDraw
Projectile_DrawTrail
RadarMapAtPoint_Sample
raptor_frame
readplayerstartcvars
sandbox_Database_Load
sandbox_ObjectPort_Load
sandbox_ObjectRemove
Seeker_Tag_Touch
setDependent_Check
ShufflePlayerOutOfTeam
spawnfunc_item_key
spawnfunc_target_items
spiderbot_frame
steerlib_beamsteer
SV_PlayerPhysics
TeleportPlayer
tracewalk
trigger_keylock_touch
trigger_relay_if_use
turret_draw2d
turret_hk_missile_think
turret_select_target
turret_stdproc_aim_generic
turret_stdproc_init
turret_stdproc_targetscore_generic
turret_stdproc_targetscore_support
turret_stdproc_track
turret_tesla_firecheck
turret_think
unquote
vehicle_initialize
vehicles_exit
vehicles_reset_colors
vehicles_showwp
vehilces_impact
VoteCount
walker_postthink
walker_rocket_think
want_weapon
WarpZone_InitStep_UpdateTransform
WarpZone_Teleport
WarpZone_TraceBox_ThroughZone
waypoint_addlink
waypoint_load_links
waypoint_load_links_hardwired
waypoint_save_links
W_Crylink_Attack
Weapon_KillMessage
Weapon_SuicideMessage
weapon_thinkf
w_electro
W_Hagar_Attack2_Load_Release
w_minelayer
w_porto
w_rlauncher
XonoticCampaignList_drawListBoxItem
XonoticCrosshairDialog_fill
XonoticCvarsDialog_fill
XonoticDemoBrowserTab_fill
XonoticEffectsSettingsTab_fill
XonoticFirstRunDialog_fill
XonoticHUDAmmoDialog_fill
XonoticHUDCenterprintDialog_fill
XonoticHUDChatDialog_fill
XonoticHUDConfirmDialog_fill
XonoticHUDDialog_fill
XonoticHUDEngineInfoDialog_fill
XonoticHUDExitDialog_fill
XonoticHUDHealthArmorDialog_fill
XonoticHUDInfoMessagesDialog_fill
XonoticHUDModIconsDialog_fill
XonoticHUDNotificationDialog_fill
XonoticHUDPhysicsDialog_fill
XonoticHUDPowerupsDialog_fill
XonoticHUDPressedKeysDialog_fill
XonoticHUDRaceTimerDialog_fill
XonoticHUDRadarDialog_fill
XonoticHUDScoreDialog_fill
XonoticHUDTimerDialog_fill
XonoticHUDVoteDialog_fill
XonoticHUDWeaponsDialog_fill
XonoticInputSettingsTab_fill
XonoticKeyBinder_drawListBoxItem
XonoticMapInfoDialog_fill
XonoticMapList_drawListBoxItem
XonoticMiscSettingsTab_fill
XonoticModelDialog_fill
XonoticMultiplayerDialog_fill
XonoticMutatorsDialog_fill
XonoticPicmipSlider_autofix
XonoticPlayerSettingsTab_fill
XonoticQuitDialog_fill
XonoticSandboxToolsDialog_fill
XonoticServerCreateTab_fill
XonoticServerInfoDialog_fill
XonoticServerInfoDialog_loadServerInfo
XonoticServerList_drawListBoxItem
XonoticServerList_setSelected
XonoticServerListTab_fill
XonoticSingleplayerDialog_fill
XonoticTeamSelectDialog_showNotify
XonoticUserbindEditDialog_fill
XonoticUserSettingsTab_fill
XonoticVideoSettingsTab_fill
XonoticViewDialog_fill
XonoticWeaponsDialog_fill
XonoticWinnerDialog_fill

Please everyone fix the issues in the function they wrote!

#6 Updated by Mirio about 1 year ago

  • Assignee set to divVerent
  • Target version set to 0.8

#7 Updated by divVerent about 1 year ago

  • Assignee deleted (divVerent)

Why assign this to me? The very reason why I posted it here was that it is too much for me alone.

Also available in: Atom PDF