#if (__GNUC__ >= 2) && !defined(USE_OLDARGS)
#define PRINTF_F(f, v) __attribute__((format(printf, f, v)))
#endif
+#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#define PRINTF_F_PTR(f, v) PRINTF_F(f, v)
+#endif
#if __GNUC__ >= 3
#define UNUSED __attribute__((unused))
#define NORETURN __attribute__((noreturn))
#ifndef PRINTF_F
#define PRINTF_F(f, v)
#endif
+#ifndef PRINTF_F_PTR
+#define PRINTF_F_PTR(f, v)
+#endif
#ifndef UNUSED
#define UNUSED
#endif
void
clear_dknown(struct obj *obj)
{
- obj->dknown = strchr(dknowns, obj->oclass) ? 0 : 1;
+ obj->dknown = index(dknowns, obj->oclass) ? 0 : 1;
if ((obj->otyp >= ELVEN_SHIELD && obj->otyp <= ORCISH_SHIELD)
|| obj->otyp == SHIELD_OF_REFLECTION
|| objects[obj->otyp].oc_merge)
register struct obj *otmp2;
if (!isok(x, y)) { /* validate location */
- void (*func)(const char *, ...) PRINTF_F(1, 2);
+ void (*func)(const char *, ...) PRINTF_F_PTR(1, 2);
func = (x < 0 || y < 0 || x > COLNO - 1 || y > ROWNO - 1) ? panic
: impossible;
otherwise the hero wouldn't be able to push one to follow the
guard out of the vault because that guard would be in its way */
if ((otmp = sobj_at(BOULDER, guard->mx, guard->my)) != 0) {
- void (*func)(const char *, ...) PRINTF_F(1, 2);
+ void (*func)(const char *, ...) PRINTF_F_PTR(1, 2);
const char *bname = simpleonames(otmp);
int bcnt = 0;