This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/35210] New: gcc incorrectly allows calling function returning "const void"


const void f(void); void g(void) {f();}

This testcase violates the constraint in C99 6.5.2.2p1 ("The expression that
denotes the called function shall have type pointer to function returning void
or returning an object type other than an array type.", so gcc at the very
least must produce a diagnostic when using -pedantic.  (BTW, is there any code
that depends on this working?)


-- 
           Summary: gcc incorrectly allows calling function returning "const
                    void"
           Product: gcc
           Version: 4.1.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eli dot friedman at gmail dot com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]