diff options
author | William Bader <williambader@hotmail.com> | 2012-03-23 08:17:24 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-03-23 08:17:24 +0000 |
commit | 573ac65eee50506b387115ea9ee97d324697d823 (patch) | |
tree | 57153bbb10c48f42107b428e483a97224348c261 /gcc | |
parent | 48d261d20a1588698f9aa4f92dfd151791c4e8e1 (diff) | |
download | gcc-573ac65eee50506b387115ea9ee97d324697d823.zip gcc-573ac65eee50506b387115ea9ee97d324697d823.tar.gz gcc-573ac65eee50506b387115ea9ee97d324697d823.tar.bz2 |
c-lex.c (c_lex_with_flags): Avoid declarations after stmts.
2012-03-23 William Bader <williambader@hotmail.com>
c-family/
* c-lex.c (c_lex_with_flags): Avoid declarations after stmts.
From-SVN: r185725
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-family/c-lex.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 350ee14..6c4ac8b 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2012-03-23 William Bader <williambader@hotmail.com> + + * c-lex.c (c_lex_with_flags): Avoid declarations after stmts. + 2012-03-20 Jason Merrill <jason@redhat.com> * c-common.h (enum cxx_dialect): Add cxx1y. diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c index 7b220ab..7e2029c 100644 --- a/gcc/c-family/c-lex.c +++ b/gcc/c-family/c-lex.c @@ -342,6 +342,8 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, if (flags & CPP_N_USERDEF) { + char *str; + tree literal; tree suffix_id = get_identifier (suffix); int len = tok->val.str.len - strlen (suffix); /* If this is going to be used as a C string to pass to a @@ -350,9 +352,9 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, (const char *) tok->val.str.text); TREE_TYPE (num_string) = char_array_type_node; num_string = fix_string_type (num_string); - char *str = CONST_CAST (char *, TREE_STRING_POINTER (num_string)); + str = CONST_CAST (char *, TREE_STRING_POINTER (num_string)); str[len] = '\0'; - tree literal = build_userdef_literal (suffix_id, *value, + literal = build_userdef_literal (suffix_id, *value, num_string); *value = literal; } |