This C program is compiled with no warning or error by mainline.

enum E { A };
void foo(unsigned int);
void (*pfn)(enum E) = foo;

My reading of ISO C says that these function pointers are not compatible types.
 I think the compiler should report something like

warning: initialization from incompatible pointer type


-- 
           Summary: C frontend permits setting a function pointer to a
                    function with different parameter type
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


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

Reply via email to