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
7e9d002a
Commit
7e9d002a
authored
Oct 18, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(parser_build_binary_op): Warn about x^y==z, etc.
From-SVN: r10473
parent
c043666f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
gcc/c-typeck.c
+9
-0
No files found.
gcc/c-typeck.c
View file @
7e9d002a
...
@@ -1823,6 +1823,9 @@ parser_build_binary_op (code, arg1, arg2)
...
@@ -1823,6 +1823,9 @@ parser_build_binary_op (code, arg1, arg2)
||
code2
==
BIT_AND_EXPR
||
code2
==
BIT_XOR_EXPR
||
code2
==
BIT_AND_EXPR
||
code2
==
BIT_XOR_EXPR
||
code2
==
PLUS_EXPR
||
code2
==
MINUS_EXPR
)
||
code2
==
PLUS_EXPR
||
code2
==
MINUS_EXPR
)
warning
(
"suggest parentheses around arithmetic in operand of |"
);
warning
(
"suggest parentheses around arithmetic in operand of |"
);
/* Check cases like x|y==z */
if
(
TREE_CODE_CLASS
(
code1
)
==
'<'
||
TREE_CODE_CLASS
(
code2
)
==
'<'
)
warning
(
"suggest parentheses around comparison in operand of |"
);
}
}
if
(
code
==
BIT_XOR_EXPR
)
if
(
code
==
BIT_XOR_EXPR
)
...
@@ -1832,6 +1835,9 @@ parser_build_binary_op (code, arg1, arg2)
...
@@ -1832,6 +1835,9 @@ parser_build_binary_op (code, arg1, arg2)
||
code2
==
BIT_AND_EXPR
||
code2
==
BIT_AND_EXPR
||
code2
==
PLUS_EXPR
||
code2
==
MINUS_EXPR
)
||
code2
==
PLUS_EXPR
||
code2
==
MINUS_EXPR
)
warning
(
"suggest parentheses around arithmetic in operand of ^"
);
warning
(
"suggest parentheses around arithmetic in operand of ^"
);
/* Check cases like x^y==z */
if
(
TREE_CODE_CLASS
(
code1
)
==
'<'
||
TREE_CODE_CLASS
(
code2
)
==
'<'
)
warning
(
"suggest parentheses around comparison in operand of ^"
);
}
}
if
(
code
==
BIT_AND_EXPR
)
if
(
code
==
BIT_AND_EXPR
)
...
@@ -1839,6 +1845,9 @@ parser_build_binary_op (code, arg1, arg2)
...
@@ -1839,6 +1845,9 @@ parser_build_binary_op (code, arg1, arg2)
if
(
code1
==
PLUS_EXPR
||
code1
==
MINUS_EXPR
if
(
code1
==
PLUS_EXPR
||
code1
==
MINUS_EXPR
||
code2
==
PLUS_EXPR
||
code2
==
MINUS_EXPR
)
||
code2
==
PLUS_EXPR
||
code2
==
MINUS_EXPR
)
warning
(
"suggest parentheses around + or - in operand of &"
);
warning
(
"suggest parentheses around + or - in operand of &"
);
/* Check cases like x&y==z */
if
(
TREE_CODE_CLASS
(
code1
)
==
'<'
||
TREE_CODE_CLASS
(
code2
)
==
'<'
)
warning
(
"suggest parentheses around comparison in operand of &"
);
}
}
}
}
...
...
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