Bug 53858

Summary: gcc warns on function prototype with incomplete type
Product: [Retired] Red Hat Linux Reporter: Ben LaHaise <bcrl>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:

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