http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57205
Bug #: 57205
Summary: unfinished function declaration and inclusion of
assert.h causes compiler errors
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: [email protected]
ReportedBy: [email protected]
If gcc is used to compile a source file which includes assert.h and contains an
incomplete function declaration, the compiler throws errors blamed on assert.h.
Here's an example which is able to reproduce this bug:
<source file="test.h">
#include <stdio.h>
int foo(FILE *file,
</header file>
<source file="test.c">
#include "test.h"
#include <assert.h>
</source file>
<compiler output>
rui@kubuntu:tmp$ gcc test.c
In file included from test.c:3:0:
/usr/include/assert.h:71:13: error: storage class specified for parameter
‘__assert_fail’
/usr/include/assert.h:76:13: error: storage class specified for parameter
‘__assert_perror_fail’
/usr/include/assert.h:84:13: error: storage class specified for parameter
‘__assert’
test.c:3:0: error: expected declaration specifiers or ‘...’ at end of input
</compiler output>
This is a small reproducible example, but in real world code the string of
error messages attributed to assert.h is even longer and more egregious.