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
4b606faf
Commit
4b606faf
authored
Oct 04, 2000
by
Will Cohen
Committed by
William Cohen
Oct 04, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patched code to generate warning when trying to perform static
initialization of zero-length arrays. From-SVN: r36714
parent
3a4fee66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
gcc/ChangeLog
+8
-11
gcc/c-typeck.c
+2
-1
gcc/extend.texi
+4
-0
No files found.
gcc/ChangeLog
View file @
4b606faf
2000-10-04 Will Cohen <wcohen@redhat.com>
* c-typeck.c (process_init_element): Added warning for zero-length
array.
* extend.texi (Zero Length): State that static initializers for
zero-length arrays are not allowed.
Mon Oct 2 14:50:14 MET DST 2000 Jan Hubicka <jh@suse.cz>
Mon Oct 2 14:50:14 MET DST 2000 Jan Hubicka <jh@suse.cz>
* rtlanal.c (single_set_1): Do not require USE and CLOBBERs
* rtlanal.c (single_set_1): Do not require USE and CLOBBERs
...
@@ -1139,17 +1147,6 @@ Mon 18-Sep-2000 19:21:35 BST Neil Booth <NeilB@earthling.net>
...
@@ -1139,17 +1147,6 @@ Mon 18-Sep-2000 19:21:35 BST Neil Booth <NeilB@earthling.net>
* config/sh/sh.md (sym_label2reg, symPLT_label2reg): Protect
* config/sh/sh.md (sym_label2reg, symPLT_label2reg): Protect
LABEL_REFs with a PIC-safe unspec.
LABEL_REFs with a PIC-safe unspec.
2000-09-18 Will Cohen <wcohen@redhat.com>
* extend.texi (Zero Length): State that static initializers for
zero-length arrays are not allowed.
* c-typeck.c (process_init_element): Flag initializers for zero
length arrays.
* tree.c (integer_all_onesp): Ignore TREE_INT_CST_HIGH if prec is
exactly HOST_BITS_PERWIDE_INT.
2000-09-18 Joseph S. Myers <jsm28@cam.ac.uk>
2000-09-18 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (check_format_info): Properly save the argument
* c-common.c (check_format_info): Properly save the argument
...
...
gcc/c-typeck.c
View file @
4b606faf
...
@@ -6460,7 +6460,8 @@ process_init_element (value)
...
@@ -6460,7 +6460,8 @@ process_init_element (value)
}
}
if
(
constructor_max_index
!=
0
if
(
constructor_max_index
!=
0
&&
tree_int_cst_lt
(
constructor_max_index
,
constructor_index
))
&&
(
tree_int_cst_lt
(
constructor_max_index
,
constructor_index
)
||
integer_all_onesp
(
constructor_max_index
)))
{
{
pedwarn_init
(
"excess elements in array initializer"
);
pedwarn_init
(
"excess elements in array initializer"
);
break
;
break
;
...
...
gcc/extend.texi
View file @
4b606faf
...
@@ -889,6 +889,10 @@ struct line @{
...
@@ -889,6 +889,10 @@ struct line @{
In
standard
C
,
you
would
have
to
give
@
code
{
contents
}
a
length
of
1
,
which
In
standard
C
,
you
would
have
to
give
@
code
{
contents
}
a
length
of
1
,
which
means
either
you
waste
space
or
complicate
the
argument
to
@
code
{
malloc
}.
means
either
you
waste
space
or
complicate
the
argument
to
@
code
{
malloc
}.
Static
initialization
of
the
zero
-
length
array
is
not
allowed
.
A
warning
will
be
generated
for
each
initializer
attempting
to
initialize
the
zero
-
length
array
.
@
node
Variable
Length
@
node
Variable
Length
@
section
Arrays
of
Variable
Length
@
section
Arrays
of
Variable
Length
@
cindex
variable
-
length
arrays
@
cindex
variable
-
length
arrays
...
...
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