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
c05f751c
Commit
c05f751c
authored
Mar 13, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(constant_expression_warning, overflow_warning): Handle REAL_CST and
COMPLEX_CST. From-SVN: r6769
parent
649ff3b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
gcc/c-common.c
+16
-4
No files found.
gcc/c-common.c
View file @
c05f751c
...
@@ -1078,9 +1078,10 @@ void
...
@@ -1078,9 +1078,10 @@ void
constant_expression_warning
(
value
)
constant_expression_warning
(
value
)
tree
value
;
tree
value
;
{
{
if
(
TREE_CODE
(
value
)
==
INTEGER_CST
&&
TREE_CONSTANT_OVERFLOW
(
value
))
if
((
TREE_CODE
(
value
)
==
INTEGER_CST
||
TREE_CODE
(
value
)
==
REAL_CST
if
(
pedantic
)
||
TREE_CODE
(
value
)
==
COMPLEX_CST
)
pedwarn
(
"overflow in constant expression"
);
&&
TREE_CONSTANT_OVERFLOW
(
value
)
&&
pedantic
)
pedwarn
(
"overflow in constant expression"
);
}
}
/* Print a warning if an expression had overflow in folding.
/* Print a warning if an expression had overflow in folding.
...
@@ -1094,11 +1095,22 @@ void
...
@@ -1094,11 +1095,22 @@ void
overflow_warning
(
value
)
overflow_warning
(
value
)
tree
value
;
tree
value
;
{
{
if
(
TREE_CODE
(
value
)
==
INTEGER_CST
&&
TREE_OVERFLOW
(
value
))
if
((
TREE_CODE
(
value
)
==
INTEGER_CST
||
(
TREE_CODE
(
value
)
==
COMPLEX_CST
&&
TREE_CODE
(
TREE_REALPART
(
value
))
==
INTEGER_CST
))
&&
TREE_OVERFLOW
(
value
))
{
{
TREE_OVERFLOW
(
value
)
=
0
;
TREE_OVERFLOW
(
value
)
=
0
;
warning
(
"integer overflow in expression"
);
warning
(
"integer overflow in expression"
);
}
}
else
if
((
TREE_CODE
(
value
)
==
REAL_CST
||
(
TREE_CODE
(
value
)
==
COMPLEX_CST
&&
TREE_CODE
(
TREE_REALPART
(
value
))
==
REAL_CST
))
&&
TREE_OVERFLOW
(
value
))
{
TREE_OVERFLOW
(
value
)
=
0
;
warning
(
"floating-pointer overflow in expression"
);
}
}
}
/* Print a warning if a large constant is truncated to unsigned,
/* Print a warning if a large constant is truncated to unsigned,
...
...
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