A
Andreas Bogenberger
Hi all,
I am corrently writing a source code analysis tool for my PhD thesis and
having a problem with pthreadtypes.h (linux, GNU libc 2.7 )
/usr/include/bits/pthreadtypes.h line 76
==============================
typedef union
{
.....
.....
unsigned int __nusers;
__extension__ union
{
int __spins;
__pthread_slist_t __list;
};
} __data;
.....
.....
} pthread_mutex_t;
==============================
the line closing the union gives me an error
so if
"union { int __spins; __pthread_slist_t __list; }"
is the specifier_qualifier_list isn't there the
declarator missing?
best regards,
Andreas
FYI, ANSI-C says:
struct_or_union_specifier
: struct_or_union IDENTIFIER '{' struct_declaration_list '}'
| struct_or_union '{' struct_declaration_list '}'
| struct_or_union IDENTIFIER
;
struct_declaration_list
: struct_declaration
| struct_declaration_list struct_declaration
;
struct_declaration
: specifier_qualifier_list struct_declarator_list ';'
;
struct_declarator_list
: struct_declarator
| struct_declarator_list ',' struct_declarator
;
struct_declarator
: declarator
| ':' constant_expression
| declarator ':' constant_expression
;
declarator
: pointer direct_declarator
| direct_declarator
;
direct_declarator
: IDENTIFIER
| '(' declarator ')'
......
......
| direct_declarator '(' identifier_list ')'
| direct_declarator '(' ')'
;
I am corrently writing a source code analysis tool for my PhD thesis and
having a problem with pthreadtypes.h (linux, GNU libc 2.7 )
/usr/include/bits/pthreadtypes.h line 76
==============================
typedef union
{
.....
.....
unsigned int __nusers;
__extension__ union
{
int __spins;
__pthread_slist_t __list;
};
} __data;
.....
.....
} pthread_mutex_t;
==============================
the line closing the union gives me an error
so if
"union { int __spins; __pthread_slist_t __list; }"
is the specifier_qualifier_list isn't there the
declarator missing?
best regards,
Andreas
FYI, ANSI-C says:
struct_or_union_specifier
: struct_or_union IDENTIFIER '{' struct_declaration_list '}'
| struct_or_union '{' struct_declaration_list '}'
| struct_or_union IDENTIFIER
;
struct_declaration_list
: struct_declaration
| struct_declaration_list struct_declaration
;
struct_declaration
: specifier_qualifier_list struct_declarator_list ';'
;
struct_declarator_list
: struct_declarator
| struct_declarator_list ',' struct_declarator
;
struct_declarator
: declarator
| ':' constant_expression
| declarator ':' constant_expression
;
declarator
: pointer direct_declarator
| direct_declarator
;
direct_declarator
: IDENTIFIER
| '(' declarator ')'
......
......
| direct_declarator '(' identifier_list ')'
| direct_declarator '(' ')'
;