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:
+10
-1
@@ -1817,7 +1817,16 @@ do_oracles()
|
|||||||
#endif
|
#endif
|
||||||
if (!(ok = (fpos = ftell(ofp)) >= 0)) break;
|
if (!(ok = (fpos = ftell(ofp)) >= 0)) break;
|
||||||
if (!(ok = (fseek(ofp, fpos, SEEK_SET) >= 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 MAC
|
||||||
# ifdef __MWERKS__
|
# ifdef __MWERKS__
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user