whitelist several non-literal format strings
djgpp cross-compiler was griping about several.
This also removes these lines from sys/unix/hints/include/compiler.370.
CFLAGS+=-Wno-format-nonliteral
CCXXFLAGS+=-Wno-format-nonliteral
-Wformat-nonliteral should not be incompatible with the printf
argument-checking capabilities on literal format strings and there
shouldn't be any new warnings created.
-- &< --
artifact.c: In function 'artifact_hit':
artifact.c:1309:23: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1309 | mon_nam(mdef));
| ^~~~~~~
artifact.c:1328:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1328 | pline(behead_msg[rn2(SIZE(behead_msg))], wepdesc, "you");
| ^~~~~
ball.c: In function 'drop_ball':
ball.c:896:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
896 | pline(pullmsg, "pit");
| ^~~~~
ball.c:899:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
899 | pline(pullmsg, "web");
| ^~~~~
ball.c:904:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
904 | pline(pullmsg, hliquid("lava"));
| ^~~~~
ball.c:908:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
908 | pline(pullmsg, "bear trap");
| ^~~~~
dig.c: In function 'liquid_flow':
dig.c:747:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
747 | pline(fillmsg, hliquid(typ == LAVAPOOL ? "lava" : "water"));
| ^~~~~
fountain.c: In function 'floating_above':
fountain.c:28:5: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
28 | You(umsg, what);
| ^~~
invent.c: In function 'hold_another_object':
invent.c:1018:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1018 | pline(drop_fmt, drop_arg);
| ^~~~~
invent.c:1073:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1073 | pline(drop_fmt, drop_arg);
| ^~~~~
invent.c: In function 'silly_thing':
invent.c:1811:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1811 | pline(silly_thing_to, word);
| ^~~~~
lock.c: In function 'pick_lock':
lock.c:375:19: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
375 | pline(no_longer, "hold the", what);
| ^~~~~~~~~
lock.c:379:19: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
379 | pline(no_longer, "reach the", "lock");
| ^~~~~~~~~
lock.c: In function 'pick_lock':
lock.c:375:19: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
375 | pline(no_longer, "hold the", what);
| ^~~~~~~~~
lock.c:379:19: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
379 | pline(no_longer, "reach the", "lock");
| ^~~~~~~~~
mcastu.c: In function 'cast_cleric_spell':
mcastu.c:670:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
670 | pline(fmt, Monnam(mtmp), what);
| ^~~~~
mhitu.c: In function 'hitmsg':
mhitu.c:68:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
68 | pline(pfmt, Monst_name);
| ^~~~~
mkobj.c: In function 'insane_object':
mkobj.c:2848:20: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2848 | impossible(altfmt, mesg, fmt_ptr((genericptr_t) obj), where_name(obj),
| ^~~~~~
mkobj.c:2852:20: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2852 | objnm);
| ^~~~~
mon.c: In function 'mon_givit':
mon.c:1469:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1469 | pline(msg, Monnam(mtmp));
| ^~~~~
mon.c: In function 'mondead':
mon.c:2485:33: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2485 | | SUPPRESS_INVISIBLE), FALSE));
| ^
muse.c: In function 'mon_reflects':
muse.c:2438:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2438 | pline(str, s_suffix(mon_nam(mon)), "shield");
| ^~~~~
muse.c:2445:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2445 | pline(str, s_suffix(mon_nam(mon)), "weapon");
| ^~~~~
muse.c:2450:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2450 | pline(str, s_suffix(mon_nam(mon)), "amulet");
| ^~~~~
muse.c:2458:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2458 | pline(str, s_suffix(mon_nam(mon)), "armor");
| ^~~~~
muse.c:2464:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2464 | pline(str, s_suffix(mon_nam(mon)), "scales");
| ^~~~~
muse.c: In function 'ureflects':
muse.c:2476:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2476 | pline(fmt, str, "shield");
| ^~~~~
muse.c:2483:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2483 | pline(fmt, str, "weapon");
| ^~~~~
muse.c:2487:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2487 | pline(fmt, str, "medallion");
| ^~~~~
muse.c:2493:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2493 | pline(fmt, str, uskin ? "luster" : "armor");
| ^~~~~
muse.c:2497:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2497 | pline(fmt, str, "scales");
| ^~~~~
polyself.c: In function 'polyman':
polyself.c:201:5: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
201 | urgent_pline(fmt, arg);
| ^~~~~~~~~~~~
potion.c: In function 'make_hallucinated':
potion.c:423:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
423 | pline(message, verb);
| ^~~~~
potion.c: In function 'peffect_gain_level':
potion.c:1033:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1033 | You(riseup, ceiling(u.ux, u.uy));
| ^~~
potion.c:1044:21: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1044 | You(riseup, ceiling(u.ux, u.uy));
| ^~~
priest.c: In function 'intemple':
priest.c:487:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
487 | You(msg1, msg2);
| ^~~
read.c: In function 'doread':
read.c:522:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
522 | pline(silly_thing_to, "read");
| ^~~~~
shk.c: In function 'shk_names_obj':
shk.c:2576:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2576 | pline(fmtbuf, obj_name, (obj->quan > 1L) ? "them" : "it", amt,
| ^~~~~~
shk.c:2579:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2579 | You(fmt, obj_name, amt, plur(amt), arg);
| ^~~
shk.c: In function 'shk_chat':
shk.c:4506:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
4506 | pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))], shkname(shkp));
| ^~~~~
shk.c: In function 'check_unpaid_usage':
shk.c:4633:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
4633 | verbalize(fmt, arg1, arg2, tmp, currency(tmp));
| ^~~~~~~~~
sounds.c: In function 'dosounds':
sounds.c:66:21: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
66 | pline(throne_msg[2], uhis());
| ^~~~~
sounds.c:259:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
259 | You_hear(msg, halu_gname(EPRI(mtmp)->shralign));
| ^~~~~~~~
timeout.c: In function 'choke_dialogue':
timeout.c:269:26: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
269 | body_part(NECK));
| ^~~~~~~~~
timeout.c:274:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
274 | urgent_pline(str, hcolor(NH_BLUE));
| ^~~~~~~~~~~~
timeout.c: In function 'levitation_dialogue':
timeout.c:339:26: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
339 | danger ? surface(u.ux, u.uy) : "air");
| ^~~~~~
timeout.c: In function 'slime_dialogue':
timeout.c:379:34: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
379 | urgent_pline(buf, hcolor(NH_GREEN));
| ^~~
timeout.c:381:30: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
381 | urgent_pline(buf, an(Hallucination ? rndmonnam(NULL)
| ^~~
uhitm.c: In function 'hmon_hitmon':
uhitm.c:1398:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1398 | pline(fmt, whom);
| ^~~~~
uhitm.c:1421:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1421 | pline(fmt, whom);
| ^~~~~
uhitm.c: In function 'stumble_onto_mimic':
uhitm.c:5301:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
5301 | pline(fmt, what);
| ^~~~~
../win/tty/wintty.c: In function 'tty_clear_nhwindow':
../win/tty/wintty.c:1649:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
1649 | panic(winpanicstr, window);
| ^~~~~~~~~~~
../win/tty/wintty.c: In function 'tty_display_nhwindow':
../win/tty/wintty.c:2339:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2339 | panic(winpanicstr, window);
| ^~~~~~~~~~~
../win/tty/wintty.c: In function 'tty_dismiss_nhwindow':
../win/tty/wintty.c:2432:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2432 | panic(winpanicstr, window);
| ^~~~~~~~~~~
../win/tty/wintty.c: In function 'tty_destroy_nhwindow':
../win/tty/wintty.c:2477:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2477 | panic(winpanicstr, window);
| ^~~~~~~~~~~
../win/tty/wintty.c: In function 'tty_curs':
../win/tty/wintty.c:2503:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2503 | panic(winpanicstr, window);
| ^~~~~~~~~~~
../win/tty/wintty.c: In function 'tty_putsym':
../win/tty/wintty.c:2599:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2599 | panic(winpanicstr, window);
| ^~~~~~~~~~~
../win/tty/wintty.c: In function 'tty_add_menu':
../win/tty/wintty.c:2967:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2967 | panic(winpanicstr, window);
| ^~~~~~~~~~~
../win/tty/wintty.c: In function 'tty_end_menu':
../win/tty/wintty.c:3032:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
3032 | panic(winpanicstr, window);
| ^~~~~~~~~~~
../win/tty/wintty.c: In function 'tty_select_menu':
../win/tty/wintty.c:3140:15: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
3140 | panic(winpanicstr, window);
| ^~~~~~~~~~~
This commit is contained in:
@@ -1130,6 +1130,8 @@ Mb_hit(struct monst *magr, /* attacker */
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* Function used when someone attacks someone else with an artifact
|
/* Function used when someone attacks someone else with an artifact
|
||||||
* weapon. Only adds the special (artifact) damage, and returns a 1 if it
|
* weapon. Only adds the special (artifact) damage, and returns a 1 if it
|
||||||
* did something special (in which case the caller won't print the normal
|
* did something special (in which case the caller won't print the normal
|
||||||
@@ -1404,6 +1406,8 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* getobj callback for object to be invoked */
|
/* getobj callback for object to be invoked */
|
||||||
static int
|
static int
|
||||||
invoke_ok(struct obj *obj)
|
invoke_ok(struct obj *obj)
|
||||||
|
|||||||
@@ -865,6 +865,8 @@ drag_ball(xchar x, xchar y, int *bc_control,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* drop_ball()
|
* drop_ball()
|
||||||
*
|
*
|
||||||
@@ -955,6 +957,8 @@ drop_ball(xchar x, xchar y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* ball&chain cause hero to randomly lose stuff from inventory */
|
/* ball&chain cause hero to randomly lose stuff from inventory */
|
||||||
static void
|
static void
|
||||||
litter(void)
|
litter(void)
|
||||||
|
|||||||
@@ -726,6 +726,8 @@ digactualhole(int x, int y, struct monst *madeby, int ttyp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called from dighole(), but also from do_break_wand()
|
* Called from dighole(), but also from do_break_wand()
|
||||||
* in apply.c.
|
* in apply.c.
|
||||||
@@ -760,6 +762,8 @@ liquid_flow(xchar x, xchar y, schar typ, struct trap *ttmp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* return TRUE if digging succeeded, FALSE otherwise */
|
/* return TRUE if digging succeeded, FALSE otherwise */
|
||||||
boolean
|
boolean
|
||||||
dighole(boolean pit_only, boolean by_magic, coord *cc)
|
dighole(boolean pit_only, boolean by_magic, coord *cc)
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ static void dowaternymph(void);
|
|||||||
static void gush(int, int, genericptr_t);
|
static void gush(int, int, genericptr_t);
|
||||||
static void dofindgem(void);
|
static void dofindgem(void);
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* used when trying to dip in or drink from fountain or sink or pool while
|
/* used when trying to dip in or drink from fountain or sink or pool while
|
||||||
levitating above it, or when trying to move downwards in that state */
|
levitating above it, or when trying to move downwards in that state */
|
||||||
void
|
void
|
||||||
@@ -28,6 +30,8 @@ floating_above(const char *what)
|
|||||||
You(umsg, what);
|
You(umsg, what);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* Fountain of snakes! */
|
/* Fountain of snakes! */
|
||||||
static void
|
static void
|
||||||
dowatersnakes(void)
|
dowatersnakes(void)
|
||||||
|
|||||||
@@ -984,6 +984,8 @@ carry_obj_effects(struct obj *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* Add an item to the inventory unless we're fumbling or it refuses to be
|
/* Add an item to the inventory unless we're fumbling or it refuses to be
|
||||||
* held (via touch_artifact), and give a message.
|
* held (via touch_artifact), and give a message.
|
||||||
* If there aren't any free inventory slots, we'll drop it instead.
|
* If there aren't any free inventory slots, we'll drop it instead.
|
||||||
@@ -1081,6 +1083,8 @@ hold_another_object(struct obj *obj, const char *drop_fmt,
|
|||||||
return (struct obj *) 0; /* might be gone */
|
return (struct obj *) 0; /* might be gone */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* useup() all of an item regardless of its quantity */
|
/* useup() all of an item regardless of its quantity */
|
||||||
void
|
void
|
||||||
useupall(struct obj *obj)
|
useupall(struct obj *obj)
|
||||||
@@ -1774,6 +1778,8 @@ getobj(const char *word,
|
|||||||
return otmp;
|
return otmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
silly_thing(const char *word,
|
silly_thing(const char *word,
|
||||||
#ifdef OBSOLETE_HANDLING
|
#ifdef OBSOLETE_HANDLING
|
||||||
@@ -1811,6 +1817,8 @@ silly_thing(const char *word,
|
|||||||
pline(silly_thing_to, word);
|
pline(silly_thing_to, word);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ckvalidcat(struct obj *otmp)
|
ckvalidcat(struct obj *otmp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -338,6 +338,8 @@ autokey(boolean opening) /* True: key, pick, or card; False: key or pick */
|
|||||||
return key ? key : pick ? pick : card ? card : 0;
|
return key ? key : pick ? pick : card ? card : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* for doapply(); if player gives a direction or resumes an interrupted
|
/* for doapply(); if player gives a direction or resumes an interrupted
|
||||||
previous attempt then it costs hero a move even if nothing ultimately
|
previous attempt then it costs hero a move even if nothing ultimately
|
||||||
happens; when told "can't do that" before being asked for direction
|
happens; when told "can't do that" before being asked for direction
|
||||||
@@ -600,6 +602,8 @@ pick_lock(struct obj *pick,
|
|||||||
return PICKLOCK_DID_SOMETHING;
|
return PICKLOCK_DID_SOMETHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* the #force command - try to force a chest with your weapon */
|
/* the #force command - try to force a chest with your weapon */
|
||||||
int
|
int
|
||||||
doforce(void)
|
doforce(void)
|
||||||
|
|||||||
@@ -531,6 +531,8 @@ cast_wizard_spell(struct monst *mtmp, int dmg, int spellnum)
|
|||||||
mdamageu(mtmp, dmg);
|
mdamageu(mtmp, dmg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cast_cleric_spell(struct monst *mtmp, int dmg, int spellnum)
|
cast_cleric_spell(struct monst *mtmp, int dmg, int spellnum)
|
||||||
{
|
{
|
||||||
@@ -753,6 +755,8 @@ cast_cleric_spell(struct monst *mtmp, int dmg, int spellnum)
|
|||||||
mdamageu(mtmp, dmg);
|
mdamageu(mtmp, dmg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
is_undirected_spell(unsigned int adtyp, int spellnum)
|
is_undirected_spell(unsigned int adtyp, int spellnum)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ static int passiveum(struct permonst *, struct monst *, struct attack *);
|
|||||||
|
|
||||||
#define ld() ((yyyymmdd((time_t) 0) - (getyear() * 10000L)) == 0xe5)
|
#define ld() ((yyyymmdd((time_t) 0) - (getyear() * 10000L)) == 0xe5)
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
hitmsg(struct monst *mtmp, struct attack *mattk)
|
hitmsg(struct monst *mtmp, struct attack *mattk)
|
||||||
{
|
{
|
||||||
@@ -69,6 +71,8 @@ hitmsg(struct monst *mtmp, struct attack *mattk)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* monster missed you */
|
/* monster missed you */
|
||||||
static void
|
static void
|
||||||
missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk)
|
missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk)
|
||||||
|
|||||||
@@ -2825,6 +2825,8 @@ where_name(struct obj *obj)
|
|||||||
return obj_state_names[where];
|
return obj_state_names[where];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static void
|
static void
|
||||||
insane_object(
|
insane_object(
|
||||||
struct obj *obj,
|
struct obj *obj,
|
||||||
@@ -2853,6 +2855,7 @@ insane_object(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* initialize a dummy obj with just enough info to allow some of the tests in
|
/* initialize a dummy obj with just enough info to allow some of the tests in
|
||||||
obj.h that take an obj pointer to work; used when applying a stethoscope
|
obj.h that take an obj pointer to work; used when applying a stethoscope
|
||||||
|
|||||||
@@ -1408,6 +1408,8 @@ meatcorpse(struct monst* mtmp) /* for purple worms and other voracious monsters
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* Maybe give an intrinsic to a monster from eating a corpse that confers it. */
|
/* Maybe give an intrinsic to a monster from eating a corpse that confers it. */
|
||||||
void
|
void
|
||||||
mon_givit(struct monst* mtmp, struct permonst* ptr)
|
mon_givit(struct monst* mtmp, struct permonst* ptr)
|
||||||
@@ -1469,6 +1471,8 @@ mon_givit(struct monst* mtmp, struct permonst* ptr)
|
|||||||
pline(msg, Monnam(mtmp));
|
pline(msg, Monnam(mtmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
mpickgold(register struct monst* mtmp)
|
mpickgold(register struct monst* mtmp)
|
||||||
{
|
{
|
||||||
@@ -2410,6 +2414,8 @@ lifesaved_monster(struct monst* mtmp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
mondead(register struct monst* mtmp)
|
mondead(register struct monst* mtmp)
|
||||||
{
|
{
|
||||||
@@ -2569,6 +2575,8 @@ mondead(register struct monst* mtmp)
|
|||||||
m_detach(mtmp, mptr);
|
m_detach(mtmp, mptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* TRUE if corpse might be dropped, magr may die if mon was swallowed */
|
/* TRUE if corpse might be dropped, magr may die if mon was swallowed */
|
||||||
boolean
|
boolean
|
||||||
corpse_chance(
|
corpse_chance(
|
||||||
|
|||||||
@@ -2428,6 +2428,8 @@ searches_for_item(struct monst* mon, struct obj* obj)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
mon_reflects(struct monst* mon, const char* str)
|
mon_reflects(struct monst* mon, const char* str)
|
||||||
{
|
{
|
||||||
@@ -2500,6 +2502,8 @@ ureflects(const char* fmt, const char* str)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* cure mon's blindness (use_defensive, dog_eat, meatobj) */
|
/* cure mon's blindness (use_defensive, dog_eat, meatobj) */
|
||||||
void
|
void
|
||||||
mcureblindness(struct monst* mon, boolean verbos)
|
mcureblindness(struct monst* mon, boolean verbos)
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ check_strangling(boolean on)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* make a (new) human out of the player */
|
/* make a (new) human out of the player */
|
||||||
static void
|
static void
|
||||||
polyman(const char *fmt, const char *arg)
|
polyman(const char *fmt, const char *arg)
|
||||||
@@ -233,6 +235,8 @@ polyman(const char *fmt, const char *arg)
|
|||||||
see_monsters();
|
see_monsters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
change_sex(void)
|
change_sex(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -353,6 +353,8 @@ toggle_blindness(void)
|
|||||||
learn_unseen_invent();
|
learn_unseen_invent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
make_hallucinated(
|
make_hallucinated(
|
||||||
long xtime, /* nonzero if this is an attempt to turn on hallucination */
|
long xtime, /* nonzero if this is an attempt to turn on hallucination */
|
||||||
@@ -425,6 +427,8 @@ make_hallucinated(
|
|||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
make_deaf(long xtime, boolean talk)
|
make_deaf(long xtime, boolean talk)
|
||||||
{
|
{
|
||||||
@@ -1019,6 +1023,8 @@ peffect_blindness(struct obj *otmp)
|
|||||||
(boolean) !Blind);
|
(boolean) !Blind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static void
|
static void
|
||||||
peffect_gain_level(struct obj *otmp)
|
peffect_gain_level(struct obj *otmp)
|
||||||
{
|
{
|
||||||
@@ -1055,6 +1061,8 @@ peffect_gain_level(struct obj *otmp)
|
|||||||
u.uexp = rndexp(TRUE);
|
u.uexp = rndexp(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static void
|
static void
|
||||||
peffect_healing(struct obj *otmp)
|
peffect_healing(struct obj *otmp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -403,6 +403,8 @@ findpriest(char roomno)
|
|||||||
return (struct monst *) 0;
|
return (struct monst *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* called from check_special_room() when the player enters the temple room */
|
/* called from check_special_room() when the player enters the temple room */
|
||||||
void
|
void
|
||||||
intemple(int roomno)
|
intemple(int roomno)
|
||||||
@@ -534,6 +536,8 @@ intemple(int roomno)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* reset the move counters used to limit temple entry feedback;
|
/* reset the move counters used to limit temple entry feedback;
|
||||||
leaving the level and then returning yields a fresh start */
|
leaving the level and then returning yields a fresh start */
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -324,6 +324,8 @@ read_ok(struct obj* obj)
|
|||||||
return GETOBJ_DOWNPLAY;
|
return GETOBJ_DOWNPLAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* the #read command; read a scroll or spell book or various other things */
|
/* the #read command; read a scroll or spell book or various other things */
|
||||||
int
|
int
|
||||||
doread(void)
|
doread(void)
|
||||||
@@ -605,6 +607,8 @@ doread(void)
|
|||||||
return ECMD_TIME;
|
return ECMD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stripspe(register struct obj* obj)
|
stripspe(register struct obj* obj)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2544,6 +2544,8 @@ bill_box_content(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* shopkeeper tells you what you bought or sold, sometimes partly IDing it */
|
/* shopkeeper tells you what you bought or sold, sometimes partly IDing it */
|
||||||
static void
|
static void
|
||||||
shk_names_obj(
|
shk_names_obj(
|
||||||
@@ -2580,6 +2582,8 @@ shk_names_obj(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* decide whether a shopkeeper thinks an item belongs to her */
|
/* decide whether a shopkeeper thinks an item belongs to her */
|
||||||
boolean
|
boolean
|
||||||
billable(
|
billable(
|
||||||
@@ -4422,6 +4426,8 @@ shk_embellish(register struct obj* itm, long cost)
|
|||||||
return ".";
|
return ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* First 4 supplied by Ronen and Tamar, remainder by development team */
|
/* First 4 supplied by Ronen and Tamar, remainder by development team */
|
||||||
const char *Izchak_speaks[] = {
|
const char *Izchak_speaks[] = {
|
||||||
"%s says: 'These shopping malls give me a headache.'",
|
"%s says: 'These shopping malls give me a headache.'",
|
||||||
@@ -4510,6 +4516,8 @@ shk_chat(struct monst* shkp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static void
|
static void
|
||||||
kops_gone(boolean silent)
|
kops_gone(boolean silent)
|
||||||
{
|
{
|
||||||
@@ -4585,6 +4593,8 @@ cost_per_charge(
|
|||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* Charge the player for partial use of an unpaid object.
|
/* Charge the player for partial use of an unpaid object.
|
||||||
*
|
*
|
||||||
* Note that bill_dummy_object() should be used instead
|
* Note that bill_dummy_object() should be used instead
|
||||||
@@ -4636,6 +4646,8 @@ check_unpaid_usage(struct obj* otmp, boolean altusage)
|
|||||||
ESHK(shkp)->debit += tmp;
|
ESHK(shkp)->debit += tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* for using charges of unpaid objects "used in the normal manner" */
|
/* for using charges of unpaid objects "used in the normal manner" */
|
||||||
void
|
void
|
||||||
check_unpaid(struct obj* otmp)
|
check_unpaid(struct obj* otmp)
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ mon_in_room(struct monst* mon, int rmtyp)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
dosounds(void)
|
dosounds(void)
|
||||||
{
|
{
|
||||||
@@ -285,6 +287,8 @@ dosounds(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static const char *const h_sounds[] = {
|
static const char *const h_sounds[] = {
|
||||||
"beep", "boing", "sing", "belche", "creak", "cough",
|
"beep", "boing", "sing", "belche", "creak", "cough",
|
||||||
"rattle", "ululate", "pop", "jingle", "sniffle", "tinkle",
|
"rattle", "ululate", "pop", "jingle", "sniffle", "tinkle",
|
||||||
|
|||||||
@@ -242,6 +242,8 @@ vomiting_dialogue(void)
|
|||||||
exercise(A_CON, FALSE);
|
exercise(A_CON, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL /* RESTORE is after slime_dialogue */
|
||||||
|
|
||||||
static NEARDATA const char *const choke_texts[] = {
|
static NEARDATA const char *const choke_texts[] = {
|
||||||
"You find it hard to breathe.",
|
"You find it hard to breathe.",
|
||||||
"You're gasping for air.",
|
"You're gasping for air.",
|
||||||
@@ -407,6 +409,8 @@ slime_dialogue(void)
|
|||||||
exercise(A_DEX, FALSE);
|
exercise(A_DEX, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
burn_away_slime(void)
|
burn_away_slime(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -721,6 +721,8 @@ hmon(struct monst *mon,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* guts of hmon() */
|
/* guts of hmon() */
|
||||||
static boolean
|
static boolean
|
||||||
hmon_hitmon(struct monst *mon,
|
hmon_hitmon(struct monst *mon,
|
||||||
@@ -1484,6 +1486,8 @@ shade_aware(struct obj *obj)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* used for hero vs monster and monster vs monster; also handles
|
/* used for hero vs monster and monster vs monster; also handles
|
||||||
monster vs hero but that won't happen because hero can't be a shade */
|
monster vs hero but that won't happen because hero can't be a shade */
|
||||||
boolean
|
boolean
|
||||||
@@ -5265,6 +5269,8 @@ passive_obj(struct monst *mon,
|
|||||||
update_inventory();
|
update_inventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* Note: caller must ascertain mtmp is mimicking... */
|
/* Note: caller must ascertain mtmp is mimicking... */
|
||||||
void
|
void
|
||||||
stumble_onto_mimic(struct monst *mtmp)
|
stumble_onto_mimic(struct monst *mtmp)
|
||||||
@@ -5308,6 +5314,8 @@ stumble_onto_mimic(struct monst *mtmp)
|
|||||||
map_invisible(mtmp->mx, mtmp->my);
|
map_invisible(mtmp->mx, mtmp->my);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nohandglow(struct monst *mon)
|
nohandglow(struct monst *mon)
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-1
@@ -994,6 +994,8 @@ decal_packed(const struct TileImage *gp, unsigned special)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open tile files,
|
* Open tile files,
|
||||||
* initialize the SCREEN, switch it to graphics mode,
|
* initialize the SCREEN, switch it to graphics mode,
|
||||||
@@ -1046,7 +1048,7 @@ vesa_Init(void)
|
|||||||
vesa_mode = 0xFFFF; /* might want an 8 bit mode after loading tiles */
|
vesa_mode = 0xFFFF; /* might want an 8 bit mode after loading tiles */
|
||||||
vesa_detect();
|
vesa_detect();
|
||||||
if (vesa_mode == 0xFFFF) {
|
if (vesa_mode == 0xFFFF) {
|
||||||
raw_printf("Reverting to TTY mode, no VESA mode available.",
|
raw_printf("%s (%d)", "Reverting to TTY mode, no VESA mode available.",
|
||||||
tilefailure);
|
tilefailure);
|
||||||
wait_synch();
|
wait_synch();
|
||||||
iflags.usevga = 0;
|
iflags.usevga = 0;
|
||||||
@@ -1163,6 +1165,8 @@ vesa_Init(void)
|
|||||||
free_tiles();
|
free_tiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* Set the size of the map viewport */
|
/* Set the size of the map viewport */
|
||||||
static void
|
static void
|
||||||
vesa_SetViewPort(void)
|
vesa_SetViewPort(void)
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers \
|
|||||||
-Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings
|
-Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings
|
||||||
CFLAGS+=-pedantic
|
CFLAGS+=-pedantic
|
||||||
CFLAGS+=-Wmissing-declarations
|
CFLAGS+=-Wmissing-declarations
|
||||||
CFLAGS+=-Wno-format-nonliteral
|
|
||||||
CFLAGS+=-Wunreachable-code
|
CFLAGS+=-Wunreachable-code
|
||||||
#
|
#
|
||||||
# the following are not allowed in C++
|
# the following are not allowed in C++
|
||||||
@@ -63,7 +62,6 @@ CCXXFLAGS+=-Wall -Wextra -Wno-missing-field-initializers \
|
|||||||
-Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings
|
-Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings
|
||||||
CCXXFLAGS+=-pedantic
|
CCXXFLAGS+=-pedantic
|
||||||
CCXXFLAGS+=-Wmissing-declarations
|
CCXXFLAGS+=-Wmissing-declarations
|
||||||
CCXXFLAGS+=-Wno-format-nonliteral
|
|
||||||
|
|
||||||
ifeq "$(CCISCLANG)" ""
|
ifeq "$(CCISCLANG)" ""
|
||||||
# gcc-specific follows
|
# gcc-specific follows
|
||||||
|
|||||||
@@ -1625,6 +1625,8 @@ free_window_info(struct WinDesc *cw, boolean free_data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
void
|
void
|
||||||
tty_clear_nhwindow(winid window)
|
tty_clear_nhwindow(winid window)
|
||||||
{
|
{
|
||||||
@@ -1680,6 +1682,8 @@ tty_clear_nhwindow(winid window)
|
|||||||
cw->curx = cw->cury = 0;
|
cw->curx = cw->cury = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
toggle_menu_curr(winid window, tty_menu_item *curr, int lineno,
|
toggle_menu_curr(winid window, tty_menu_item *curr, int lineno,
|
||||||
boolean in_view, boolean counting, long count)
|
boolean in_view, boolean counting, long count)
|
||||||
@@ -2307,6 +2311,8 @@ process_text_window(winid window, struct WinDesc *cw)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISABLE_WARNING_FORMAT_NONLITERAL /* RESTORE after tty_select_menu */
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
tty_display_nhwindow(
|
tty_display_nhwindow(
|
||||||
@@ -3149,6 +3155,8 @@ tty_select_menu(winid window, int how, menu_item **menu_list)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
/* special hack for treating top line --More-- as a one item menu */
|
/* special hack for treating top line --More-- as a one item menu */
|
||||||
char
|
char
|
||||||
tty_message_menu(char let, int how, const char *mesg)
|
tty_message_menu(char let, int how, const char *mesg)
|
||||||
|
|||||||
Reference in New Issue
Block a user