This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Warning for non-portable integer operations?
On Mon, May 11, 2009 at 12:04 AM, Ian Lance Taylor <iant@google.com> wrote:
> Mark Dickinson <dickinsm@gmail.com> writes:
>
>> Is there any gcc warning available that would
>> warn about the following C code, which gives
>> different results depending on the platform:
>
> -Wconversion
Thanks. It's not quite what I was looking for, since it still doesn't
give any warning on LP64 machines, and on ILP32 it's warning
about the comparison rather than the arithmetic operation. But
I guess I'll live. :) I suppose it doesn't really make sense for
gcc to warn about possible problems on a platform different from
the one it's targeting.
This seems like the sort of thing that 3rd party static-analysis
tools would do well, but the only one that I tried (splint) failed to
parse the various non-standards-compliant systems header files,
so never got as far as the code I was interested in...
Mark