projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3b6770c
)
Supress the error message that the array size must be an integer expression if the...
author
Christoph Mallon
<christoph.mallon@gmx.de>
Fri, 20 Feb 2009 16:38:59 +0000
(16:38 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Fri, 20 Feb 2009 16:38:59 +0000
(16:38 +0000)
[r25533]
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
8ad8b86
..
6f63a8a
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-4395,10
+4395,12
@@
static construct_type_t *parse_array_declarator(void)
expression_t *const size = parse_assignment_expression();
/* §6.7.5.2:1 Array size must have integer type */
expression_t *const size = parse_assignment_expression();
/* §6.7.5.2:1 Array size must have integer type */
- if (!is_type_integer(skip_typeref(size->base.type))) {
+ type_t *const orig_type = size->base.type;
+ type_t *const type = skip_typeref(orig_type);
+ if (!is_type_integer(type) && is_type_valid(type)) {
errorf(&size->base.source_position,
"array size '%E' must have integer type but has type '%T'",
errorf(&size->base.source_position,
"array size '%E' must have integer type but has type '%T'",
- size,
size->base.
type);
+ size,
orig_
type);
}
array->size = size;
}
array->size = size;