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
103b7b17
Commit
103b7b17
authored
Mar 28, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(process_init_constructor, digest_init):
Check and set new static var partial_bracket_mentioned. From-SVN: r3899
parent
f41372d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
gcc/c-typeck.c
+20
-4
No files found.
gcc/c-typeck.c
View file @
103b7b17
...
@@ -33,6 +33,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
...
@@ -33,6 +33,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "c-tree.h"
#include "c-tree.h"
#include "flags.h"
#include "flags.h"
/* Nonzero if we've already printed a "partly bracketed initializer"
message within this initializer. */
static
int
partial_bracket_mentioned
=
0
;
extern
char
*
index
();
extern
char
*
index
();
extern
char
*
rindex
();
extern
char
*
rindex
();
...
@@ -4689,7 +4693,8 @@ pedwarn_init (format, local, ofwhat)
...
@@ -4689,7 +4693,8 @@ pedwarn_init (format, local, ofwhat)
If OFWHAT is nonnull, it specifies what we are initializing, for error
If OFWHAT is nonnull, it specifies what we are initializing, for error
messages. Examples: variable name, variable.member, array[44].
messages. Examples: variable name, variable.member, array[44].
If OFWHAT is null, the component name is stored on the spelling stack. */
If OFWHAT is null, the component name is stored on the spelling stack.
(That is true for all nested calls to digest_init.) */
tree
tree
digest_init
(
type
,
init
,
tail
,
require_constant
,
constructor_constant
,
ofwhat
)
digest_init
(
type
,
init
,
tail
,
require_constant
,
constructor_constant
,
ofwhat
)
...
@@ -4706,6 +4711,11 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat)
...
@@ -4706,6 +4711,11 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat)
=
TREE_CODE
(
init
)
==
CONSTRUCTOR
&&
TREE_TYPE
(
init
)
==
0
;
=
TREE_CODE
(
init
)
==
CONSTRUCTOR
&&
TREE_TYPE
(
init
)
==
0
;
tree
inside_init
=
init
;
tree
inside_init
=
init
;
/* Make sure there is just one "partially bracketed" message
per top-level initializer or constructor. */
if
(
ofwhat
!=
0
)
partial_bracket_mentioned
=
0
;
/* By default, assume we use one element from a list.
/* By default, assume we use one element from a list.
We correct this later in the sole case where it is not true. */
We correct this later in the sole case where it is not true. */
...
@@ -5030,8 +5040,10 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat)
...
@@ -5030,8 +5040,10 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat)
OFWHAT is a character string describing the object being initialized,
OFWHAT is a character string describing the object being initialized,
for error messages. It might be "variable" or "variable.member"
for error messages. It might be "variable" or "variable.member"
or "variable[17].member[5]". If OFWHAT is null, the description string
or "variable[17].member[5]".
is stored on the spelling stack. */
If OFWHAT is null, the description string is stored on the spelling
stack. That is always true for recursive calls. */
static
tree
static
tree
process_init_constructor
(
type
,
init
,
elts
,
constant_value
,
constant_element
,
process_init_constructor
(
type
,
init
,
elts
,
constant_value
,
constant_element
,
...
@@ -5059,7 +5071,11 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
...
@@ -5059,7 +5071,11 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
if
(
elts
)
if
(
elts
)
{
{
if
(
warn_missing_braces
)
if
(
warn_missing_braces
)
warning
(
"aggregate has a partly bracketed initializer"
);
{
if
(
!
partial_bracket_mentioned
)
warning
(
"aggregate has a partly bracketed initializer"
);
partial_bracket_mentioned
=
1
;
}
tail
=
*
elts
;
tail
=
*
elts
;
}
}
else
else
...
...
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