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
9b69f523
Commit
9b69f523
authored
Oct 10, 1993
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(check_format_info): Support X/Open formats like "%1$d".
From-SVN: r5707
parent
02490c73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletions
+33
-1
gcc/c-common.c
+33
-1
No files found.
gcc/c-common.c
View file @
9b69f523
...
...
@@ -528,10 +528,12 @@ check_format_info (info, params)
tree
cur_param
;
tree
cur_type
;
tree
wanted_type
;
tree
first_fillin_param
;
char
*
format_chars
;
format_char_info
*
fci
;
static
char
message
[
132
];
char
flag_chars
[
8
];
int
has_operand_number
=
0
;
/* Skip to format argument. If the argument isn't available, there's
no work for us to do; prototype checking will catch the problem. */
...
...
@@ -577,13 +579,15 @@ check_format_info (info, params)
params
=
TREE_CHAIN
(
params
);
++
arg_num
;
}
first_fillin_param
=
params
;
while
(
1
)
{
if
(
*
format_chars
==
0
)
{
if
(
format_chars
-
TREE_STRING_POINTER
(
format_tree
)
!=
format_length
)
warning
(
"embedded `
\\
0' in format"
);
if
(
info
->
first_arg_num
!=
0
&&
params
!=
0
)
if
(
info
->
first_arg_num
!=
0
&&
params
!=
0
&&
!
has_operand_number
)
warning
(
"too many arguments for format"
);
return
;
}
...
...
@@ -611,6 +615,34 @@ check_format_info (info, params)
}
else
{
/* See if we have a number followed by a dollar sign. If we do,
it is an operand number, so set PARAMS to that operand. */
if
(
*
format_chars
>=
'0'
&&
*
format_chars
<=
'9'
)
{
char
*
p
=
format_chars
;
while
(
*
p
>=
'0'
&&
*
p
++
<=
'9'
)
;
if
(
*
p
==
'$'
)
{
int
opnum
=
atoi
(
format_chars
);
params
=
first_fillin_param
;
format_chars
=
p
+
1
;
has_operand_number
=
1
;
for
(
i
=
1
;
i
<
opnum
&&
params
!=
0
;
i
++
)
params
=
TREE_CHAIN
(
params
);
if
(
opnum
==
0
||
params
==
0
)
{
warning
(
"operand number out of range in format"
);
return
;
}
}
}
while
(
*
format_chars
!=
0
&&
index
(
" +#0-"
,
*
format_chars
)
!=
0
)
{
if
(
index
(
flag_chars
,
*
format_chars
)
!=
0
)
...
...
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