------- Comment #2 from falk at debian dot org  2009-04-14 14:47 -------
The problem comes from some convoluted code that was apparently substituted for
strlen to special-case constant arguments. It boils down to:

int f(void) {
  if (0)
    return ((const char *) "")[2];
  return 0;
}

(without the cast, no warning is given).


-- 

falk at debian dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
      Known to fail|                            |4.5.0
      Known to work|                            |4.4.0
            Summary|possible bogus offset       |[4.5 regression] warning
                   |warning                     |"outside bounds of constant
                   |                            |string" not suppressed in
                   |                            |dead code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39748

Reply via email to