[Bug c/21486] New: C Compiler does NOT signal anything when there is an increment of char * without target variable

frans at iunknown dot org gcc-bugzilla@gcc.gnu.org
Tue May 10 10:53:00 GMT 2005


This simple source code:

#include <stdio.h>

main()
    {
    char *p;

    p+21;

    return 1;
    }

does NOT cause the gcc compiler to warn or signal any error. Pointer p remains
the same, before and after the 'strange' increment.
If the compiler does not signal anything about that, in a large source code it's
a very hard task to find where the problem is.

-- 
           Summary: C Compiler does NOT signal anything when there is an
                    increment of char * without target variable
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: frans at iunknown dot org
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list