summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-lex.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-26 19:31:16 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-26 19:31:16 +0000
commit5c1b1ffa84c21d338b1d4290c8dcebb6c2a8aef7 (patch)
tree21ade8d4825d9024836e5cce7f12ddde0032b6c9 /gcc/c-family/c-lex.c
parent244db24d8ddff5d5788dc1f10c971d815c9b4388 (diff)
downloadgcc-5c1b1ffa84c21d338b1d4290c8dcebb6c2a8aef7.tar.gz
build_string comments
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180537 138bc75d-0d04-0410-961f-82ee72b054a4
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 baee8eb9799..7b220abd4b8 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;