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
c16b611e
Commit
c16b611e
authored
Oct 27, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(pushdecl): Don't test TREE_PUBLIC when deciding whether to register a
duplicate decl in the current block. From-SVN: r10528
parent
926b1b99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
gcc/c-decl.c
+10
-1
No files found.
gcc/c-decl.c
View file @
c16b611e
...
@@ -1900,6 +1900,7 @@ pushdecl (x)
...
@@ -1900,6 +1900,7 @@ pushdecl (x)
{
{
char
*
file
;
char
*
file
;
int
line
;
int
line
;
int
declared_global
;
/* Don't type check externs here when -traditional. This is so that
/* Don't type check externs here when -traditional. This is so that
code with conflicting declarations inside blocks will get warnings
code with conflicting declarations inside blocks will get warnings
...
@@ -1921,6 +1922,9 @@ pushdecl (x)
...
@@ -1921,6 +1922,9 @@ pushdecl (x)
line
=
DECL_SOURCE_LINE
(
t
);
line
=
DECL_SOURCE_LINE
(
t
);
}
}
/* duplicate_decls might write to TREE_PUBLIC (x) and DECL_EXTERNAL (x)
to make it identical to the initial declaration. */
declared_global
=
TREE_PUBLIC
(
x
)
||
DECL_EXTERNAL
(
x
);
if
(
t
!=
0
&&
duplicate_decls
(
x
,
t
))
if
(
t
!=
0
&&
duplicate_decls
(
x
,
t
))
{
{
if
(
TREE_CODE
(
t
)
==
PARM_DECL
)
if
(
TREE_CODE
(
t
)
==
PARM_DECL
)
...
@@ -1934,7 +1938,10 @@ pushdecl (x)
...
@@ -1934,7 +1938,10 @@ pushdecl (x)
warn. But don't complain if -traditional,
warn. But don't complain if -traditional,
since traditional compilers don't complain. */
since traditional compilers don't complain. */
if
(
!
flag_traditional
&&
TREE_PUBLIC
(
name
)
if
(
!
flag_traditional
&&
TREE_PUBLIC
(
name
)
/* should this be '&& ! declared_global' ? */
&&
!
TREE_PUBLIC
(
x
)
&&
!
DECL_EXTERNAL
(
x
)
&&
!
TREE_PUBLIC
(
x
)
&&
!
DECL_EXTERNAL
(
x
)
/* We used to warn also for explicit extern followed by static,
/* We used to warn also for explicit extern followed by static,
but sometimes you need to do it that way. */
but sometimes you need to do it that way. */
&&
IDENTIFIER_IMPLICIT_DECL
(
name
)
!=
0
)
&&
IDENTIFIER_IMPLICIT_DECL
(
name
)
!=
0
)
...
@@ -1949,7 +1956,9 @@ pushdecl (x)
...
@@ -1949,7 +1956,9 @@ pushdecl (x)
/* If this is a global decl, and there exists a conflicting local
/* If this is a global decl, and there exists a conflicting local
decl in a parent block, then we can't return as yet, because we
decl in a parent block, then we can't return as yet, because we
need to register this decl in the current binding block. */
need to register this decl in the current binding block. */
if
(
!
TREE_PUBLIC
(
x
)
||
lookup_name
(
name
)
==
t
)
/* A test for TREE_PUBLIC (x) will fail for variables that have
been declared static first, and extern now. */
if
(
!
declared_global
||
lookup_name
(
name
)
==
t
)
return
t
;
return
t
;
}
}
...
...
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