Hello, This code doesn't appear to be correct in ANSI-C, but ok in C99 :
struct a { int x; int y; } z;
What are the differences about struct in C99 and ANSI-C ?
Edit: I forgot the "a", my bad. This code compiles ok with gcc in C99 mode, but is a parse error on splint, which is known to not support all the C99 extensions.
Edit2: here is the output of splint :
Splint 3.1.2 --- 19 Dec 2007
build/ecos_install/include/cyg/fileio/fileio.h:151:5:
Parse Error. Attempting to continue.
build/ecos_install/include/cyg/fileio/fileio.h:151:25:
Cannot recover from parse error.
*** Cannot continue.
Edit3: This file is the eCos fileio.h (the last line of this fragment is line 152) :
typedef CYG_ADDRWORD cyg_dir;
//=============================================================================
// Filesystem table entry
typedef int cyg_fsop_mount ( cyg_fstab_entry *fste, cyg_mtab_entry *mte );
typedef int cyg_fsop_umount ( cyg_mtab_entry *mte );
typedef int cyg_fsop_open ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
int mode, cyg_file *fte );
typedef int cyg_fsop_unlink ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
typedef int cyg_fsop_mkdir ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
typedef int cyg_fsop_rmdir ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
typedef int cyg_fsop_rename ( cyg_mtab_entry *mte, cyg_dir dir1, const char *name1,
cyg_dir dir2, const char *name2 );
typedef int cyg_fsop_link ( cyg_mtab_entry *mte, cyg_dir dir1, const char *name1,
cyg_dir dir2, const char *name2, int type );
typedef int cyg_fsop_opendir ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
cyg_file *fte );
typedef int cyg_fsop_chdir ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
cyg_dir *dir_out );
typedef int cyg_fsop_stat ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
struct stat *buf);
typedef int cyg_fsop_getinfo ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
int key, void *buf, int len );
typedef int cyg_fsop_setinfo ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
int key, void *buf, int len );
struct cyg_fstab_entry
{
const char *name; // filesystem name
CYG_ADDRWORD data; // private data value
cyg_uint32 syncmode; // synchronization mode
cyg_fsop_mount *mount;
cyg_fsop_umount *umount;
cyg_fsop_open *open;
cyg_fsop_unlink *unlink;
cyg_fsop_mkdir *mkdir;
cyg_fsop_rmdir *rmdir;
cyg_fsop_rename *rename;
cyg_fsop_link *link;
cyg_fsop_opendir *opendir;
cyg_fsop_chdir *chdir;
cyg_fsop_stat *stat;
cyg_fsop_getinfo *getinfo;
cyg_fsop_setinfo *setinfo;
} CYG_HAL_TABLE_TYPE;