projects
/
cparser
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix off-by-one error in error message.
[cparser]
/
ast2firm.c
diff --git
a/ast2firm.c
b/ast2firm.c
index
79c5078
..
bffaed2
100644
(file)
--- a/
ast2firm.c
+++ b/
ast2firm.c
@@
-63,7
+63,6
@@
static label_t **all_labels;
static entity_t **inner_functions;
static ir_node *ijmp_list;
static bool constant_folding;
static entity_t **inner_functions;
static ir_node *ijmp_list;
static bool constant_folding;
-static symbol_t *sym_C;
extern bool have_const_functions;
extern bool have_const_functions;
@@
-1026,14
+1025,9
@@
static ir_entity *get_function_entity(entity_t *entity)
/* force main to C linkage */
type_t *type = entity->declaration.type;
assert(is_type_function(type));
/* force main to C linkage */
type_t *type = entity->declaration.type;
assert(is_type_function(type));
- if (type->function.linkage != NULL && type->function.linkage != sym_C) {
- errorf(&entity->base.source_position,
- "main must have \"C\" linkage");
- }
-
- if (type->function.linkage == NULL || type->function.linkage != sym_C) {
+ if (type->function.linkage != LINKAGE_C) {
type_t *new_type = duplicate_type(type);
type_t *new_type = duplicate_type(type);
- new_type->function.linkage =
sym
_C;
+ new_type->function.linkage =
LINKAGE
_C;
type = typehash_insert(new_type);
if (type != new_type) {
type = typehash_insert(new_type);
if (type != new_type) {
@@
-3293,7
+3287,7
@@
static __attribute__((unused)) void debug_print_type_path(const type_path_t *pat
if (is_type_compound(type)) {
fprintf(stderr, ".%s", entry->compound_entry->base.symbol->string);
} else if (is_type_array(type)) {
if (is_type_compound(type)) {
fprintf(stderr, ".%s", entry->compound_entry->base.symbol->string);
} else if (is_type_array(type)) {
- fprintf(stderr, "[%
zu]",
entry->index);
+ fprintf(stderr, "[%
u]", (unsigned)
entry->index);
} else {
fprintf(stderr, "-INVALID-");
}
} else {
fprintf(stderr, "-INVALID-");
}
@@
-5448,8
+5442,6
@@
void init_ast2firm(void)
rts_idents[i] = new_id_from_str(rts_data[i].name);
}
rts_idents[i] = new_id_from_str(rts_data[i].name);
}
- sym_C = symbol_table_insert("C");
-
entitymap_init(&entitymap);
}
entitymap_init(&entitymap);
}