[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
INT_ADD_OVERFLOW broken?
From: |
Daniel Colascione |
Subject: |
INT_ADD_OVERFLOW broken? |
Date: |
Sat, 21 Sep 2013 17:39:26 -0700 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
When trying to compile this code:
if (INT_ADD_OVERFLOW ((ptrdiff_t) (bool_header_size - header_size),
total_payload_bytes))
memory_full (SIZE_MAX);
gcc produces this warning:
alloc.c:2051: warning: assuming signed overflow does not occur when
assuming that (X + c) >= X is always true [-Wstrict-overflow]
Is INT_ADD_OVERFLOW actually safe?
signature.asc
Description: OpenPGP digital signature
- INT_ADD_OVERFLOW broken?,
Daniel Colascione <=