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
c40f7b33
Commit
c40f7b33
authored
Feb 11, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(grokdeclarator): Use NAME, not IDENTIFIER_POINTER of DECLARATOR for
error messages; DECLARATOR might be null. From-SVN: r8907
parent
5788afc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
gcc/c-decl.c
+9
-13
No files found.
gcc/c-decl.c
View file @
c40f7b33
/* Process declarations and variables for C compiler.
/* Process declarations and variables for C compiler.
Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc.
Copyright (C) 1988, 1992, 1993, 1994
, 1995
Free Software Foundation, Inc.
This file is part of GNU CC.
This file is part of GNU CC.
...
@@ -4727,8 +4727,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
...
@@ -4727,8 +4727,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
&&
!
(
specbits
&&
!
(
specbits
&
((
1
<<
(
int
)
RID_STATIC
)
|
(
1
<<
(
int
)
RID_REGISTER
)))))))
&
((
1
<<
(
int
)
RID_STATIC
)
|
(
1
<<
(
int
)
RID_REGISTER
)))))))
{
{
error
(
"variable or field `%s' declared void"
,
error
(
"variable or field `%s' declared void"
,
name
);
IDENTIFIER_POINTER
(
declarator
));
type
=
integer_type_node
;
type
=
integer_type_node
;
}
}
...
@@ -4802,14 +4801,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
...
@@ -4802,14 +4801,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if
(
TREE_CODE
(
type
)
==
FUNCTION_TYPE
)
if
(
TREE_CODE
(
type
)
==
FUNCTION_TYPE
)
{
{
error
(
"field `%s' declared as a function"
,
error
(
"field `%s' declared as a function"
,
name
);
IDENTIFIER_POINTER
(
declarator
));
type
=
build_pointer_type
(
type
);
type
=
build_pointer_type
(
type
);
}
}
else
if
(
TREE_CODE
(
type
)
!=
ERROR_MARK
&&
TYPE_SIZE
(
type
)
==
0
)
else
if
(
TREE_CODE
(
type
)
!=
ERROR_MARK
&&
TYPE_SIZE
(
type
)
==
0
)
{
{
error
(
"field `%s' has incomplete type"
,
error
(
"field `%s' has incomplete type"
,
name
);
IDENTIFIER_POINTER
(
declarator
));
type
=
error_mark_node
;
type
=
error_mark_node
;
}
}
/* Move type qualifiers down to element of an array. */
/* Move type qualifiers down to element of an array. */
...
@@ -4838,19 +4835,16 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
...
@@ -4838,19 +4835,16 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if
(
specbits
&
(
1
<<
(
int
)
RID_AUTO
)
if
(
specbits
&
(
1
<<
(
int
)
RID_AUTO
)
&&
(
pedantic
||
current_binding_level
==
global_binding_level
))
&&
(
pedantic
||
current_binding_level
==
global_binding_level
))
pedwarn
(
"invalid storage class for function `%s'"
,
pedwarn
(
"invalid storage class for function `%s'"
,
name
);
IDENTIFIER_POINTER
(
declarator
));
if
(
specbits
&
(
1
<<
(
int
)
RID_REGISTER
))
if
(
specbits
&
(
1
<<
(
int
)
RID_REGISTER
))
error
(
"invalid storage class for function `%s'"
,
error
(
"invalid storage class for function `%s'"
,
name
);
IDENTIFIER_POINTER
(
declarator
));
/* Function declaration not at top level.
/* Function declaration not at top level.
Storage classes other than `extern' are not allowed
Storage classes other than `extern' are not allowed
and `extern' makes no difference. */
and `extern' makes no difference. */
if
(
current_binding_level
!=
global_binding_level
if
(
current_binding_level
!=
global_binding_level
&&
(
specbits
&
((
1
<<
(
int
)
RID_STATIC
)
|
(
1
<<
(
int
)
RID_INLINE
)))
&&
(
specbits
&
((
1
<<
(
int
)
RID_STATIC
)
|
(
1
<<
(
int
)
RID_INLINE
)))
&&
pedantic
)
&&
pedantic
)
pedwarn
(
"invalid storage class for function `%s'"
,
pedwarn
(
"invalid storage class for function `%s'"
,
name
);
IDENTIFIER_POINTER
(
declarator
));
/* If this is a block level extern, it must live past the end
/* If this is a block level extern, it must live past the end
of the function so that we can check it against other
of the function so that we can check it against other
...
@@ -4870,9 +4864,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
...
@@ -4870,9 +4864,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if
(
extern_ref
)
if
(
extern_ref
)
DECL_EXTERNAL
(
decl
)
=
1
;
DECL_EXTERNAL
(
decl
)
=
1
;
/* Record absence of global scope for `static' or `auto'. */
/* Record absence of global scope for `static' or `auto'. */
TREE_PUBLIC
(
decl
)
TREE_PUBLIC
(
decl
)
=
!
(
specbits
&
((
1
<<
(
int
)
RID_STATIC
)
|
(
1
<<
(
int
)
RID_AUTO
)));
=
!
(
specbits
&
((
1
<<
(
int
)
RID_STATIC
)
|
(
1
<<
(
int
)
RID_AUTO
)));
/* Record presence of `inline', if it is reasonable. */
/* Record presence of `inline', if it is reasonable. */
if
(
inlinep
)
if
(
inlinep
)
{
{
...
...
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