enable -Wformat-nonliteral for linux and equivalent for windows compilers
Whitelist all the verified existing triggers: makedefs.c: In function ‘name_file’ attrib.c: one compiler balks at a ? b : c for fmtstring cmd.c: In function ‘extcmd_via_menu’ cmd.c: In function ‘wiz_levltyp_legend’ do.c: In function ‘goto_level’ do_name.c: In function ‘coord_desc’ dungeon.c: In function ‘overview_stats’ eat.c: one compiler balks at a ? b : c for fmtstring end.c: one compiler balks at a ? b : c for fmtstring engrave.c: In function ‘engr_stats’ hack:c one compiler balks at a ? b : c for fmtstring hacklib.c: one compiler balks at a ? b : c for fmtstring insight.c: one compiler balks at a ? b : c for fmtstring invent.c: In function ‘let_to_name’ light.c: In function ‘light_stats’ mhitm.c: In function ‘missmm’ options.c: In function ‘handler_symset’ options.c: In function ‘basic_menu_colors’ options.c: In function ‘optfn_o_autopickup_exceptions’ options.c: In function ‘optfn_o_menu_colors’ options.c: In function ‘optfn_o_message_types’ options.c: In function ‘optfn_o_status_cond’ options.c: In function ‘optfn_o_status_hilites’ options.c: In function ‘doset’ options.c: In function ‘doset_add_menu’ options.c: In function ‘show_menu_controls’ options.c: In function ‘handle_add_list_remove’ pager.c: In function ‘do_supplemental_info’ pager.c: In function ‘dohelp’ region.c: In function ‘region_stats’ rumors.c: sscanf usage sounds.c: In function ‘domonnoise’ spell.c: In function ‘dospellmenu’ timeout.c: In function ‘timer_stats’ topten.c: In function ‘outentry’, fscanf, sscanf, fprintf usage windows.c: In function ‘genl_status_update’ zap.c: one compiler balks at a ? b : c for fmtstring win/curses/cursstat.c: In function ‘curses_status_update’ win/tty/wintty.c: In function ‘tty_status_update’ win/win32/mswproc.c: In function ‘mswin_status_update’
This commit is contained in:
@@ -136,6 +136,8 @@ curses_status_finish(void)
|
||||
|
||||
static int changed_fields = 0;
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
void
|
||||
curses_status_update(int fldidx, genericptr_t ptr, int chg UNUSED, int percent,
|
||||
int color_and_attr, unsigned long *colormasks)
|
||||
@@ -202,6 +204,8 @@ curses_status_update(int fldidx, genericptr_t ptr, int chg UNUSED, int percent,
|
||||
}
|
||||
}
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static void
|
||||
draw_status(void)
|
||||
{
|
||||
@@ -981,6 +985,8 @@ curs_HPbar(char *text, /* pre-padded with trailing spaces if short */
|
||||
extern const struct conditions_t conditions[]; /* botl.c */
|
||||
extern int cond_idx[CONDITION_COUNT];
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static void
|
||||
curs_stat_conds(
|
||||
int vert_cond, /* 0 => horizontal, 1 => vertical */
|
||||
@@ -1104,6 +1110,8 @@ curs_stat_conds(
|
||||
return;
|
||||
}
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* status_update() sets up values for horizontal status; do vertical */
|
||||
void
|
||||
curs_vert_status_vals(int win_width)
|
||||
|
||||
@@ -3843,6 +3843,8 @@ tty_status_enablefield(int fieldidx, const char *nm, const char *fmt,
|
||||
* See doc/window.doc for more details.
|
||||
*/
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
void
|
||||
tty_status_update(int fldidx, genericptr_t ptr, int chg UNUSED, int percent,
|
||||
int color, unsigned long *colormasks)
|
||||
@@ -3964,6 +3966,8 @@ tty_status_update(int fldidx, genericptr_t ptr, int chg UNUSED, int percent,
|
||||
return;
|
||||
}
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static int
|
||||
make_things_fit(boolean force_update)
|
||||
{
|
||||
|
||||
@@ -3072,6 +3072,9 @@ status_update(int fldindex, genericptr_t ptr, int chg, int percent, int color, u
|
||||
longs telling which conditions should be displayed in each
|
||||
color and attriubte.
|
||||
*/
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
void
|
||||
mswin_status_update(int idx, genericptr_t ptr, int chg, int percent, int color, unsigned long *condmasks)
|
||||
{
|
||||
@@ -3173,3 +3176,5 @@ mswin_status_update(int idx, genericptr_t ptr, int chg, int percent, int color,
|
||||
}
|
||||
}
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Gs /Oi- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/Gs /Oi- /w44774 %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
@@ -43,7 +43,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="@(Lua)">
|
||||
<DisableSpecificWarnings>4701;4702;4244;4310</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings>4701;4702;4244;4310;4774</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(SrcDir)allmain.c" />
|
||||
<ClCompile Include="$(SrcDir)alloc.c" />
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Gs /Oi- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/Gs /Oi- /w44774 %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<OmitFramePointers>true</OmitFramePointers>
|
||||
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWinntDir);$(SysShareDir);$(WinShareDir);$(LuaDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -37,7 +37,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="@(Lua)">
|
||||
<DisableSpecificWarnings>4701;4702;4244;4310</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings>4701;4702;4244;4310;4774</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(SrcDir)allmain.c" />
|
||||
<ClCompile Include="$(SrcDir)alloc.c" />
|
||||
|
||||
Reference in New Issue
Block a user