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
2918ed3c
Commit
2918ed3c
authored
Mar 22, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r568
parent
bd0725f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
gcc/c-typeck.c
+7
-2
No files found.
gcc/c-typeck.c
View file @
2918ed3c
...
@@ -3666,7 +3666,10 @@ build_c_cast (type, expr)
...
@@ -3666,7 +3666,10 @@ build_c_cast (type, expr)
if
(
TREE_CODE
(
type
)
==
POINTER_TYPE
if
(
TREE_CODE
(
type
)
==
POINTER_TYPE
&&
TREE_CODE
(
otype
)
==
INTEGER_TYPE
&&
TREE_CODE
(
otype
)
==
INTEGER_TYPE
&&
TYPE_PRECISION
(
type
)
!=
TYPE_PRECISION
(
otype
))
&&
TYPE_PRECISION
(
type
)
!=
TYPE_PRECISION
(
otype
)
/* Don't warn about converting 0 to pointer,
provided the 0 was explicit--not cast or made by folding. */
&&
!
(
TREE_CODE
(
value
)
==
INTEGER_CST
&&
integer_zerop
(
value
)))
warning
(
"cast to pointer from integer of different size"
);
warning
(
"cast to pointer from integer of different size"
);
value
=
convert
(
type
,
value
);
value
=
convert
(
type
,
value
);
...
@@ -3953,7 +3956,9 @@ convert_for_assignment (type, rhs, errtype, funname, parmnum)
...
@@ -3953,7 +3956,9 @@ convert_for_assignment (type, rhs, errtype, funname, parmnum)
}
}
else
if
(
codel
==
POINTER_TYPE
&&
coder
==
INTEGER_TYPE
)
else
if
(
codel
==
POINTER_TYPE
&&
coder
==
INTEGER_TYPE
)
{
{
if
(
!
integer_zerop
(
rhs
))
/* An explicit constant 0 can convert to a pointer,
but not a 0 that results from casting or folding. */
if
(
!
(
TREE_CODE
(
rhs
)
==
INTEGER_CST
&&
integer_zerop
(
rhs
)))
{
{
warn_for_assignment
(
"%s makes pointer from integer without a cast"
,
warn_for_assignment
(
"%s makes pointer from integer without a cast"
,
get_spelling
(
errtype
),
funname
,
parmnum
);
get_spelling
(
errtype
),
funname
,
parmnum
);
...
...
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