Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
1c9e4b35
Commit
1c9e4b35
authored
Sep 15, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
declared and not used; this time for sure
R=ken OCL=34657 CL=34657
parent
67ab1b9f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
gen.c
src/cmd/gc/gen.c
+1
-4
range.c
src/cmd/gc/range.c
+1
-1
typecheck.c
src/cmd/gc/typecheck.c
+1
-1
walk.c
src/cmd/gc/walk.c
+14
-0
No files found.
src/cmd/gc/gen.c
View file @
1c9e4b35
...
...
@@ -48,12 +48,8 @@ allocparams(void)
}
if
(
n
->
op
!=
ONAME
||
n
->
class
!=
PAUTO
)
continue
;
lineno
=
n
->
lineno
;
typecheck
(
&
n
,
Erv
|
Easgn
);
// only needed for unused variables
if
(
n
->
type
==
T
)
continue
;
// if(!n->used && n->sym->name[0] != '&')
// yyerror("%S declared and not used", n->sym);
dowidth
(
n
->
type
);
w
=
n
->
type
->
width
;
if
(
w
>=
100000000
)
...
...
@@ -447,6 +443,7 @@ cgen_discard(Node *nr)
switch
(
nr
->
op
)
{
case
ONAME
:
gused
(
nr
);
break
;
// unary
...
...
src/cmd/gc/range.c
View file @
1c9e4b35
...
...
@@ -82,7 +82,7 @@ out:
n
->
typecheck
=
1
;
for
(
ll
=
n
->
list
;
ll
;
ll
=
ll
->
next
)
if
(
ll
->
n
->
typecheck
==
0
)
typecheck
(
&
ll
->
n
,
Erv
);
typecheck
(
&
ll
->
n
,
Erv
|
Easgn
);
}
void
...
...
src/cmd/gc/typecheck.c
View file @
1c9e4b35
...
...
@@ -1975,7 +1975,7 @@ out:
n
->
typecheck
=
1
;
for
(
ll
=
n
->
list
;
ll
;
ll
=
ll
->
next
)
if
(
ll
->
n
->
typecheck
==
0
)
typecheck
(
&
ll
->
n
,
Erv
);
typecheck
(
&
ll
->
n
,
Erv
|
Easgn
);
}
/*
...
...
src/cmd/gc/walk.c
View file @
1c9e4b35
...
...
@@ -67,6 +67,9 @@ void
walk
(
Node
*
fn
)
{
char
s
[
50
];
NodeList
*
l
;
Node
*
n
;
int
lno
;
curfn
=
fn
;
if
(
debug
[
'W'
])
{
...
...
@@ -77,6 +80,17 @@ walk(Node *fn)
if
(
walkret
(
curfn
->
nbody
))
yyerror
(
"function ends without a return statement"
);
typechecklist
(
curfn
->
nbody
,
Etop
);
lno
=
lineno
;
for
(
l
=
fn
->
dcl
;
l
;
l
=
l
->
next
)
{
n
=
l
->
n
;
if
(
n
->
op
!=
ONAME
||
n
->
class
!=
PAUTO
)
continue
;
lineno
=
n
->
lineno
;
typecheck
(
&
n
,
Erv
|
Easgn
);
// only needed for unused variables
if
(
!
n
->
used
&&
n
->
sym
->
name
[
0
]
!=
'&'
)
yyerror
(
"%S declared and not used"
,
n
->
sym
);
}
lineno
=
lno
;
if
(
nerrors
!=
0
)
return
;
walkstmtlist
(
curfn
->
nbody
);
...
...
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