This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: how to make gcc warn about arithmetic signed overflow
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 26 Sep 2013 15:49:05 +0100
- Subject: Re: how to make gcc warn about arithmetic signed overflow
- Authentication-results: sourceware.org; auth=none
- References: <20130921164609 dot GC3086 at a dot lan> <CAH6eHdTToM+TMy55m5HYo39DC8nA0RrTma1Bp5OnhUtPErMfOA at mail dot gmail dot com> <20130921174229 dot GD3086 at a dot lan> <CAH6eHdQzJNQY4Meysi259RheSaGscKUF28OW43OvOD1rf6FkxQ at mail dot gmail dot com> <20130923000355 dot fa2a964c dot jklowden at schemamania dot org> <CALqwTFMfRi6sZY6Ffpdp0E4d4xiJT0EHRUQH-+Oph5c5AWR3-Q at mail dot gmail dot com> <52409B07 dot 1070002 at redhat dot com> <20130923180022 dot b06c9ae2 dot jklowden at schemamania dot org> <5241D058 dot 6000209 at redhat dot com> <20130925222958 dot 63f91bc9 dot jklowden at schemamania dot org> <20130926082941 dot GA31230 at ypig dot lip dot ens-lyon dot fr>
On 09/26/2013 09:29 AM, Vincent Lefevre wrote:
> On 2013-09-25 22:29:58 -0400, James K. Lowden wrote:
>> You mean that a naïve rendering of the source code implies an overflow
>> where none might exist in the actual emitted object code. And,
>> presumably, the converse: that even if the source is written such that
>> there logically can't be an overflow, the compiler might render object
>> code that does.
>
> The converse is forbidden.
You'll find it hard to justify that by any language in the standard.
Andrew.