This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: pointer <-> integer conversion warnings (bogus -Wall warnings )
- From: Tom Lord <lord at emf dot net>
- To: Dautrevaux at microprocess dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 18 Mar 2002 01:24:48 -0800 (PST)
- Subject: Re: pointer <-> integer conversion warnings (bogus -Wall warnings )
- References: <17B78BDF120BD411B70100500422FC6309E4E4@IIS000>
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