aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-lex.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2011-10-26 15:31:16 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-10-26 15:31:16 -0400
commit1ca3916f5688863f49976febd57b1a9640d1c71a (patch)
tree21ade8d4825d9024836e5cce7f12ddde0032b6c9 /gcc/c-family/c-lex.c
parent3ce4f9e4d2643273f11647e97b2c7796a64a73dd (diff)
downloadgcc-1ca3916f5688863f49976febd57b1a9640d1c71a.zip
gcc-1ca3916f5688863f49976febd57b1a9640d1c71a.tar.gz
gcc-1ca3916f5688863f49976febd57b1a9640d1c71a.tar.bz2
build_string comments
From-SVN: r180537
Diffstat (limited to 'gcc/c-family/c-lex.c')
-rw-r--r--gcc/c-family/c-lex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c
index baee8eb..7b220ab 100644
--- a/gcc/c-family/c-lex.c
+++ b/gcc/c-family/c-lex.c
@@ -344,6 +344,8 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
{
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
+ raw literal operator, we need to add a trailing NUL. */
tree num_string = build_string (len + 1,
(const char *) tok->val.str.text);
TREE_TYPE (num_string) = char_array_type_node;