Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
fe9ef5d7
Commit
fe9ef5d7
authored
May 03, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(digest_init): Check size properly for wide-string.
From-SVN: r4309
parent
22cc53bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
gcc/c-typeck.c
+6
-2
No files found.
gcc/c-typeck.c
View file @
fe9ef5d7
...
...
@@ -4829,9 +4829,13 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat)
{
register
int
size
=
TREE_INT_CST_LOW
(
TYPE_SIZE
(
type
));
size
=
(
size
+
BITS_PER_UNIT
-
1
)
/
BITS_PER_UNIT
;
/* Subtract 1 because it's ok to ignore the terminating null char
/* Subtract 1 (or sizeof (wchar_t))
because it's ok to ignore the terminating null char
that is counted in the length of the constant. */
if
(
size
<
TREE_STRING_LENGTH
(
string
)
-
1
)
if
(
size
<
TREE_STRING_LENGTH
(
string
)
-
(
TYPE_PRECISION
(
typ1
)
!=
TYPE_PRECISION
(
char_type_node
)
?
TYPE_PRECISION
(
wchar_type_node
)
/
BITS_PER_UNIT
:
1
))
pedwarn_init
(
"initializer-string for array of chars%s is too long"
,
" `%s'"
,
ofwhat
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment