public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35210] New: gcc incorrectly allows calling function returning "const void"
@ 2008-02-15 16:11 eli dot friedman at gmail dot com
2008-02-15 17:35 ` [Bug c/35210] " schwab at suse dot de
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: eli dot friedman at gmail dot com @ 2008-02-15 16:11 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/35210] gcc incorrectly allows calling function returning "const void"
2008-02-15 16:11 [Bug c/35210] New: gcc incorrectly allows calling function returning "const void" eli dot friedman at gmail dot com
@ 2008-02-15 17:35 ` schwab at suse dot de
2008-02-15 18:01 ` eli dot friedman at gmail dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: schwab at suse dot de @ 2008-02-15 17:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from schwab at suse dot de 2008-02-15 17:35 -------
6.7.3p2: The properties associated with qualified types are meaningful
only for expressions that are lvalues.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35210
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/35210] gcc incorrectly allows calling function returning "const void"
2008-02-15 16:11 [Bug c/35210] New: gcc incorrectly allows calling function returning "const void" eli dot friedman at gmail dot com
2008-02-15 17:35 ` [Bug c/35210] " schwab at suse dot de
@ 2008-02-15 18:01 ` eli dot friedman at gmail dot com
2009-04-18 14:25 ` jsm28 at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: eli dot friedman at gmail dot com @ 2008-02-15 18:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from eli dot friedman at gmail dot com 2008-02-15 18:01 -------
Yes, but "const void" is still a distinct type from "void".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35210
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/35210] gcc incorrectly allows calling function returning "const void"
2008-02-15 16:11 [Bug c/35210] New: gcc incorrectly allows calling function returning "const void" eli dot friedman at gmail dot com
2008-02-15 17:35 ` [Bug c/35210] " schwab at suse dot de
2008-02-15 18:01 ` eli dot friedman at gmail dot com
@ 2009-04-18 14:25 ` jsm28 at gcc dot gnu dot org
2009-04-18 20:03 ` jsm28 at gcc dot gnu dot org
2009-04-18 20:04 ` jsm28 at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-04-18 14:25 UTC (permalink / raw)
To: gcc-bugs
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |16620, 16989
nThis| |
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-04-18 14:25:23
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35210
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/35210] gcc incorrectly allows calling function returning "const void"
2008-02-15 16:11 [Bug c/35210] New: gcc incorrectly allows calling function returning "const void" eli dot friedman at gmail dot com
` (2 preceding siblings ...)
2009-04-18 14:25 ` jsm28 at gcc dot gnu dot org
@ 2009-04-18 20:03 ` jsm28 at gcc dot gnu dot org
2009-04-18 20:04 ` jsm28 at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-04-18 20:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jsm28 at gcc dot gnu dot org 2009-04-18 20:03 -------
Subject: Bug 35210
Author: jsm28
Date: Sat Apr 18 20:02:47 2009
New Revision: 146324
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146324
Log:
PR c/35210
* c-typeck.c (build_function_call): Check for calling a function
with qualified void return types. Call require_complete_type when
generating a trap.
testsuite:
* gcc.dg/call-diag-2.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/call-diag-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-typeck.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35210
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/35210] gcc incorrectly allows calling function returning "const void"
2008-02-15 16:11 [Bug c/35210] New: gcc incorrectly allows calling function returning "const void" eli dot friedman at gmail dot com
` (3 preceding siblings ...)
2009-04-18 20:03 ` jsm28 at gcc dot gnu dot org
@ 2009-04-18 20:04 ` jsm28 at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-04-18 20:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jsm28 at gcc dot gnu dot org 2009-04-18 20:04 -------
Fixed for 4.5.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Known to work| |4.5.0
Resolution| |FIXED
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35210
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-04-18 20:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-15 16:11 [Bug c/35210] New: gcc incorrectly allows calling function returning "const void" eli dot friedman at gmail dot com
2008-02-15 17:35 ` [Bug c/35210] " schwab at suse dot de
2008-02-15 18:01 ` eli dot friedman at gmail dot com
2009-04-18 14:25 ` jsm28 at gcc dot gnu dot org
2009-04-18 20:03 ` jsm28 at gcc dot gnu dot org
2009-04-18 20:04 ` jsm28 at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).