projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
59b11d8
)
A function declaration with unspecified parameter list is compatible to a declaration...
author
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 27 Nov 2007 15:40:15 +0000
(15:40 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 27 Nov 2007 15:40:15 +0000
(15:40 +0000)
[r18553]
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
e1db29c
..
19b00c0
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-443,6
+443,17
@@
static void set_context(context_t *new_context)
static bool is_compatible_declaration (declaration_t *declaration,
declaration_t *previous)
{
static bool is_compatible_declaration (declaration_t *declaration,
declaration_t *previous)
{
+ if (declaration->type->type == TYPE_FUNCTION &&
+ previous->type->type == TYPE_FUNCTION &&
+ previous->type->function.unspecified_parameters) {
+ function_type_t* const prev_func = &previous->type->function;
+ function_type_t* const decl_func = &declaration->type->function;
+ if (prev_func->unspecified_parameters &&
+ prev_func->result_type == decl_func->result_type) {
+ declaration->type = previous->type;
+ return true;
+ }
+ }
/* TODO: not correct yet */
return declaration->type == previous->type;
}
/* TODO: not correct yet */
return declaration->type == previous->type;
}