c-lex.c (c_lex_with_flags): Avoid declarations after stmts.
authorWilliam Bader <williambader@hotmail.com>
Fri, 23 Mar 2012 08:17:24 +0000 (08:17 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 23 Mar 2012 08:17:24 +0000 (08:17 +0000)
2012-03-23  William Bader  <williambader@hotmail.com>

c-family/
* c-lex.c (c_lex_with_flags): Avoid declarations after stmts.

From-SVN: r185725

gcc/c-family/ChangeLog
gcc/c-family/c-lex.c

index 350ee14b90deff56f17e749ee9227c7078700588..6c4ac8b1edbc768a97e25db0921dae28fcac6df9 100644 (file)
@@ -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.
index 7b220abd4b8c5070931758028ac5ba2609bb5116..7e2029ce05679316e532ee20ff74140344ffbf2d 100644 (file)
@@ -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;
          }