c-common.c (binary_op_error): Do not allow NOP_EXPR.
authorJoseph Myers <joseph@codesourcery.com>
Sun, 4 Dec 2005 21:45:41 +0000 (21:45 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sun, 4 Dec 2005 21:45:41 +0000 (21:45 +0000)
commit1344f9a3189ed48181c844c7d2cc1f70511ab898
tree09a78feaae42dbb50fdaf694eca604caa1029b35
parentd77314ece616e1a2626ebd2f6abf55ecda0b440f
c-common.c (binary_op_error): Do not allow NOP_EXPR.

* c-common.c (binary_op_error): Do not allow NOP_EXPR.
(c_common_truthvalue_conversion): Handle NOP_EXPR the same as
CONVERT_EXPR.
(check_function_arguments_recurse): Allow both NOP_EXPR and
CONVERT_EXPR but check conversions preserve precision.
* c-typeck.c (pointer_diff): Allow both NOP_EXPR and CONVERT_EXPR
but check conversions preserve precision.
(build_unary_op): Don't allow NOP_EXPR.  Use gcc_unreachable () in
default case.

testsuite:
* gcc.dg/format/cast-1.c: New test.

From-SVN: r108020
gcc/ChangeLog
gcc/c-common.c
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/format/cast-1.c [new file with mode: 0644]