[openssl-dev] [openssl.org #4474] Overflow optimizations being taken by GCC

2016-06-02 Thread Stephen Henson via RT
It looks like a lot of these warnings are bogus. For example ct_validation is
only ever set to 0 or 1 yet it throws out a warning with if(ct_vlidation) in
one place while not warning about a similar expression just above it.

I tidied up ocsp_prn.c which avoided the warning in that file: though again it
didn't seem to be genuine.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org

-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4474
Please log in as guest with password guest if prompted

-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


[openssl-dev] [openssl.org #4474] Overflow optimizations being taken by GCC

2016-03-24 Thread noloa...@gmail.com via RT
$ ./config -Wstrict-overflow
...

$ make
...

crypto/asn1/a_strex.c: In function ‘do_print_ex.constprop.3’:
crypto/asn1/a_strex.c:385:12: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
 if (len < 0)
^
crypto/asn1/a_strex.c:385:12: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
crypto/asn1/a_strex.c:404:8: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
 if (len < 0)
^
crypto/asn1/a_strex.c:413:8: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
 if (do_buf(str->data, str->length, type, flags, NULL, io_ch, arg) < 0)
^
crypto/asn1/a_strex.c: In function ‘do_print_ex.constprop.4’:
crypto/asn1/a_strex.c:385:12: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
 if (len < 0)
^
crypto/asn1/a_strex.c:385:12: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
crypto/asn1/a_strex.c:404:8: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
 if (len < 0)
^
crypto/asn1/a_strex.c:413:8: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
 if (do_buf(str->data, str->length, type, flags, NULL, io_ch, arg) < 0)



crypto/bio/b_print.c:716:15: warning: assuming signed overflow does
not occur when simplifying conditional to constant [-Wstrict-overflow]
 while (fplace > 0) {
   ^


crypto/bn/bn_exp.c:377:13: warning: assuming signed overflow does not
occur when simplifying conditional to constant [-Wstrict-overflow]
 for (i = 0; i < j; i++) {
 ^
crypto/bn/bn_exp.c: In function ‘BN_mod_exp_mont’:
crypto/bn/bn_exp.c:541:13: warning: assuming signed overflow does not
occur when simplifying conditional to constant [-Wstrict-overflow]
 for (i = 0; i < j; i++) {
 ^
crypto/bn/bn_exp.c: In function ‘BN_mod_exp_simple’:
crypto/bn/bn_exp.c:1433:13: warning: assuming signed overflow does not
occur when simplifying conditional to constant [-Wstrict-overflow]
 for (i = 0; i < j; i++) {
 ^


crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
 for (p = ts; p < ts + len; p++)
 ^
crypto/ocsp/ocsp_prn.c: In function ‘OCSP_cert_status_str’:
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
 for (p = ts; p < ts + len; p++)
 ^
crypto/ocsp/ocsp_prn.c: In function ‘OCSP_crl_reason_str’:
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
 for (p = ts; p < ts + len; p++)
 ^
crypto/ocsp/ocsp_prn.c: In function ‘OCSP_response_status_str’:
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
 for (p = ts; p < ts + len; p++)
 ^
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
crypto/ocsp/ocsp_prn.c: In function ‘OCSP_cert_status_str’:
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
 for (p = ts; p < ts + len; p++)
 ^
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
crypto/ocsp/ocsp_prn.c: In function ‘OCSP_crl_reason_str’:
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
 for (p = ts; p < ts + len; p++)
 ^
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
crypto/ocsp/ocsp_prn.c:96:5: warning: assuming pointer wraparound does
not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]



ssl/ssl_lib.c:4023:50: warning: assuming signed overflow does not
occur when simplifying conditional to constant [-Wstrict-overflow]
 if (ct_extract_tls_extension_scts(s) < 0 ||
  ^



apps/ca.c:619:8: warning: assuming signed overflow does not occur when
simplifying conditional to