This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/56910] New: Syntax error seemingly sneaks through gcc
- From: "daven at model dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Apr 2013 17:19:58 +0000
- Subject: [Bug c/56910] New: Syntax error seemingly sneaks through gcc
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56910
Bug #: 56910
Summary: Syntax error seemingly sneaks through gcc
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: daven@model.com
I'm not sure if the following code is triggering some obscure extension
to gcc or not, but it sure seems like it should generate a syntax
error (it does in all other compilers I've tried).
--- cut here (z.c) ---
typedef int int32_t;
typedef unsigned int uint32_t;
#include <stdio.h>
extern void vl_create_cell_reg(
int32_t reg_idx,
int32_t state_idx,
uint32_t CR_flags,
uint32_t init_val,
char *name; /* <--- this parameter is missing in the body and contains a
spurious ';' */
);
void vl_create_cell_reg( int32_t reg_idx, int32_t state_idx, uint32_t CR_flags,
uint32_t init_val )
{
}
--- cut here (end of z.c) ---
If I cut/paste this source to a file called "z.c", it compiles fine, i.e.:
$ gcc -c -Wall -Werror z.c
<< no errors/warnings reported >>
Note, if I remove the spurious ';', I get the expected error:
$ gcc -c -Wall -Werror z.c
z.c:15:6: error: conflicting types for âvl_create_cell_regâ
z.c:7:13: note: previous declaration of âvl_create_cell_regâ was here