Bug 53858 - gcc warns on function prototype with incomplete type
Summary: gcc warns on function prototype with incomplete type
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-09-20 02:31 UTC by Ben LaHaise
Modified: 2007-04-18 16:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-07 12:49:29 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Ben LaHaise 2001-09-20 02:31:41 UTC
Compiling the below program produces a warning when it should not.  This
bug is also present in the gcc3 package.  Cheers!

[bcrl@toomuch ~]$ gcc -Wall -o /dev/null gcc-warning.c 
gcc-warning.c:4: warning: parameter has incomplete type

... gcc-warning.c ...
struct iocb;
struct foo {
	void (*bar)(struct iocb);
};

Comment 1 Jakub Jelinek 2001-09-24 09:34:51 UTC
It is true that ISO C99 allows incomplete types in function prototypes, on the
other side I don't think it forbids such a warning. I'll ask Joseph what he
thinks about it.

Comment 2 Jakub Jelinek 2004-10-07 12:49:29 UTC
Tracked upstream: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17881


Note You need to log in before you can comment on or make changes to this bug.