[Bug c/25801] bad diagnostic for increment/decrement of pointer to incomplete array

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jan 16 01:25:00 GMT 2006



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-01-16 01:25 -------
The problem with the first error message is obvious where it goes wrong (in
c-typeck.c):
            if (!COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (result_type)))
              {
                if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
                  error ("increment of pointer to unknown structure");
                else
                  error ("decrement of pointer to unknown structure");

The second one comes from calling c_size_in_bytes.  It seems like we can remove
the error call from c_size_in_bytes as the other place were we call it, we
check for a imcomplete type right before calling it.
Oh and the second error message also happens with the struct case too.

Both are these problems are not a regression as far as I can tell as both wrong
error messages are in 2.95.3.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
      Known to fail|                            |2.95.3 3.3.1 3.0.4 3.4.0
                   |                            |4.0.0 4.1.0 4.2.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-16 01:25:15
               date|                            |


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



More information about the Gcc-bugs mailing list