suppress makedefs.c diagnostic (trunk only)

gcc doesn't complain about using %lx to write out a signed long, but
it does complain about using it to read into a signed long.  Technically
it's right about the latter, so fix this properly rather than just suppress
the message with a cast.
This commit is contained in:
nethack.rankin
2012-01-12 04:01:08 +00:00
parent af0201b063
commit 5506be3b91

View File

@@ -1817,7 +1817,16 @@ do_oracles()
#endif
if (!(ok = (fpos = ftell(ofp)) >= 0)) break;
if (!(ok = (fseek(ofp, fpos, SEEK_SET) >= 0))) break;
if (!(ok = (fscanf(ofp, "%5lx", &offset) == 1))) break;
{
/* gcc's format checking issues a warning when using
%lx to read into a signed long, so force unsigned;
casting &offset to unsigned long * works but is iffy */
unsigned long uloffset;
int itmp = fscanf(ofp, "%5lx", &uloffset);
offset = (long)uloffset;
if (!(ok = (itmp == 1))) break;
}
#ifdef MAC
# ifdef __MWERKS__
/*