This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/57205] New: unfinished function declaration and inclusion of assert.h causes compiler errors


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: unassigned@gcc.gnu.org
        ReportedBy: rui.maciel@gmail.com


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]