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