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
f500253d
Commit
f500253d
authored
Apr 14, 1996
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(finish_enum): Don't crash if no type can represent all enumeration values.
From-SVN: r11771
parent
4ea62d1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
gcc/c-decl.c
+10
-2
No files found.
gcc/c-decl.c
View file @
f500253d
...
@@ -5894,8 +5894,16 @@ finish_enum (enumtype, values, attributes)
...
@@ -5894,8 +5894,16 @@ finish_enum (enumtype, values, attributes)
if
(
flag_short_enums
||
TYPE_PACKED
(
enumtype
)
if
(
flag_short_enums
||
TYPE_PACKED
(
enumtype
)
||
precision
>
TYPE_PRECISION
(
integer_type_node
))
||
precision
>
TYPE_PRECISION
(
integer_type_node
))
/* Use the width of the narrowest normal C type which is wide enough. */
{
TYPE_PRECISION
(
enumtype
)
=
TYPE_PRECISION
(
type_for_size
(
precision
,
1
));
tree
narrowest
=
type_for_size
(
precision
,
1
);
if
(
narrowest
==
0
)
{
warning
(
"enumeration values exceed range of largest integer"
);
narrowest
=
long_long_integer_type_node
;
}
TYPE_PRECISION
(
enumtype
)
=
TYPE_PRECISION
(
narrowest
);
}
else
else
TYPE_PRECISION
(
enumtype
)
=
TYPE_PRECISION
(
integer_type_node
);
TYPE_PRECISION
(
enumtype
)
=
TYPE_PRECISION
(
integer_type_node
);
...
...
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