pointer <-> integer conversion warnings (bogus -Wall warnings )
Tom Lord
lord@emf.net
Mon Mar 18 01:24:00 GMT 2002
Dautrevaux@microprocess.com
I was just stressing that "x = (int)p" is NOT equivalent, in
the standard, to "x = (int)((char *)p - (char *)0)" as you
suggest,
I did not suggest that those expressions were equivalent in any
standard.
Then, as you were looking at a portable way to silent this
warning, I think it is relevant to note that the warning you
want to silent has NO portable meaning
No, that is not especially relevant. The question is whether a
single, ordinary cast ought to be sufficient to mark the legal,
non-portable construct as "intentional", and thus not worthy (under
some combination of options) of warning.
-t
More information about the Gcc
mailing list