Spoiler: Warnings (formatting may be affected by word wrap)Fixed in this pull request.Code: Select all
src/fragglescript/t_func.cpp:2680:49: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat] script_error("weaponnum out of range! %s\n", weaponnum); ~~ ^~~~~~~~~ %d src/fragglescript/t_func.cpp:2686:54: warning: data argument not used by format string [-Wformat-extra-args] script_error("incompatibility in playerweapon\n", weaponnum); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ src/fragglescript/t_func.cpp:2761:50: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat] script_error("weaponnum out of range! %s\n", weaponnum); ~~ ^~~~~~~~~ %d src/fragglescript/t_func.cpp:2767:55: warning: data argument not used by format string [-Wformat-extra-args] script_error("incompatibility in playerweapon\n", weaponnum); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ src/g_doomedmap.cpp:249:20: warning: more '%' conversions than data arguments [-Wformat] sc.ScriptError("%d errors encountered in DoomEdNum definition"); src/scripting/codegeneration/codegen.cpp:7496:101: warning: data argument not used by format string [-Wformat-extra-args] ScriptPosition.Message(MSG_ERROR, "Qualified member call to parent class not yet implemented\n", cls->TypeName.GetChars(), MethodName.GetChars()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ src/scripting/codegeneration/codegen.cpp:7900:80: warning: data argument not used by format string [-Wformat-extra-args] ScriptPosition.Message(MSG_ERROR, "Type mismatch in reference argument", Function->SymbolName.GetChars()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ src/scripting/codegeneration/codegen.cpp:8349:89: warning: data argument not used by format string [-Wformat-extra-args] ScriptPosition.Message(MSG_ERROR, "GetDefaultByType() requires an actor class type", static_cast<FxConstant *>(Self)->GetValue().GetString().GetChars()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ src/scripting/codegeneration/codegen.cpp:9515:26: warning: data argument not used by format string [-Wformat-extra-args] clsname.GetChars(), desttype->TypeName.GetChars()); ^ src/scripting/thingdef.cpp:275:34: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] owner->TypeName.GetChars(), state - owner->OwnedStates, obj->TypeName.GetChars(), FName(*test).GetChars()); ^~~~~~~~~~~~~~~~~~~~~~~~~~ src/scripting/thingdef_properties.cpp:528:107: warning: data argument not used by format string [-Wformat-extra-args] "'skip_super' is only allowed in subclasses of AActor with no additional fields and will be ignored.", info->TypeName.GetChars()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ src/scripting/zscript/zcc_compile.cpp:1326:135: warning: format specifies type 'char *' but the argument has type 'unsigned int' [-Wformat] Error(field, "Cannot add field %s to %s. %s has native children which means it size may not change.", type->TypeName.GetChars(), fd->FieldSize, FName(name->Name).GetChars()); ~~ ^~~~~~~~~~~~~ %u
Format strings warnings
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Format strings warnings
There is bunch of format strings warnings reported by GCC/Clang. They clutter compiler's output and the real bug may slip through.
Spoiler: Warnings (formatting may be affected by word wrap)Fixed in this pull request.
-
Edward-san
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: Format strings warnings
I reported already here. There's also a request to split a change into a proper commit for easy backporting to forks not having zscript yet.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Format strings warnings
The one in zcc_compile.cpp is not correct. In that case it's not the format specifier that's wrong but the value being passed.
Re: Format strings warnings
Force pushed the changes.