aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-tree.h
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-07-22 00:46:20 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-07-22 00:46:20 +0100
commit916c59199cfbe12788cef6ad2b7cb8ffdc59af71 (patch)
tree3445b1b5b70b8f6f28f797b70463fa6e393fa8e1 /gcc/c-tree.h
parentbf6c40e92d589b24583ef6e5494bd17a78c13033 (diff)
downloadgcc-916c59199cfbe12788cef6ad2b7cb8ffdc59af71.zip
gcc-916c59199cfbe12788cef6ad2b7cb8ffdc59af71.tar.gz
gcc-916c59199cfbe12788cef6ad2b7cb8ffdc59af71.tar.bz2
re PR c/11250 (-pedantic accepts `char a[] = ("x");')
PR c/11250 * c-parse.in (init): Change to exprtype. (primary): Set original_code for STRING to STRING_CST. Call maybe_warn_string_init for compound literals. (initdcl, notype_initdcl): Call maybe_warn_string_init. (initval): Update. * c-tree.h (maybe_warn_string_init): New. (pop_init_level, process_init_element): Use struct c_expr. (struct c_expr): Update comment. * c-typeck.c (maybe_warn_string_init): New function. (digest_init): Call it. Additional parameter strict_string. All callers changed. (output_init_element): Likewise. (struct constructor_stack): Use struct c_expr for replacement_value. (really_start_incremental_init, push_init_level): Update. (pop_init_level): Update. Return struct c_expr. (process_init_level): Update. Take struct c_expr argument. testsuite: * gcc.dg/init-string-1.c: New test. From-SVN: r85022
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r--gcc/c-tree.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index d6cdc97..9e24953 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -119,8 +119,9 @@ struct c_expr
/* The value of the expression. */
tree value;
/* Record the original binary operator of an expression, which may
- have been changed by fold, or ERROR_MARK for other expressions
- (including parenthesized expressions). */
+ have been changed by fold, STRING_CST for unparenthesised string
+ constants, or ERROR_MARK for other expressions (including
+ parenthesized expressions). */
enum tree_code original_code;
};
@@ -244,14 +245,15 @@ extern tree build_modify_expr (tree, enum tree_code, tree);
extern void store_init_value (tree, tree);
extern void error_init (const char *);
extern void pedwarn_init (const char *);
+extern void maybe_warn_string_init (tree, struct c_expr);
extern void start_init (tree, tree, int);
extern void finish_init (void);
extern void really_start_incremental_init (tree);
extern void push_init_level (int);
-extern tree pop_init_level (int);
+extern struct c_expr pop_init_level (int);
extern void set_init_index (tree, tree);
extern void set_init_label (tree);
-extern void process_init_element (tree);
+extern void process_init_element (struct c_expr);
extern tree build_compound_literal (tree, tree);
extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_PRINTF_1;