This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35210] New: gcc incorrectly allows calling function returning "const void"
- From: "eli dot friedman at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Feb 2008 16:10:37 -0000
- Subject: [Bug c/35210] New: gcc incorrectly allows calling function returning "const void"
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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