From a32c8316ff282ec3eb60e222e91fb19998c12f46 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Wed, 9 Aug 2017 08:51:20 +0000 Subject: re PR c/81417 (-Wsign-compare should print types being compared) PR c/81417 * c-array-notation.c (fix_builtin_array_notation_fn): Update calls to build_conditional_expr. * c-parser.c (c_parser_conditional_expression): Create locations for EXP1 and EXP2 from their source ranges. Pass the locations down to build_conditional_expr. * c-tree.h (build_conditional_expr): Update declaration. * c-typeck.c (build_conditional_expr): Add location_t parameters. For -Wsign-compare, also print the types. * input.c (make_location): New overload. * input.h (make_location): Declare. * objc-next-runtime-abi-02.c (build_v2_build_objc_method_call): Update a call to build_conditional_expr. * Wsign-compare-1.c: New test. * gcc.dg/compare1.c: Adjust dg-bogus. * gcc.dg/compare2.c: Likewise. * gcc.dg/compare3.c: Likewise. * gcc.dg/compare7.c: Likewise. * gcc.dg/compare8.c: Likewise. * gcc.dg/compare9.c: Likewise. * gcc.dg/pr11492.c: Likewise. From-SVN: r250984 --- gcc/testsuite/gcc.dg/compare8.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/testsuite/gcc.dg/compare8.c') diff --git a/gcc/testsuite/gcc.dg/compare8.c b/gcc/testsuite/gcc.dg/compare8.c index d723c45..d09b69c 100644 --- a/gcc/testsuite/gcc.dg/compare8.c +++ b/gcc/testsuite/gcc.dg/compare8.c @@ -4,18 +4,18 @@ int f(unsigned short a1, unsigned short a2, unsigned int b) { - return ((a1+a2)|5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */ + return ((a1+a2)|5) > b ? 2 : 3; /* { dg-bogus "changes signedness" } */ } int g(unsigned short a1, unsigned short a2, unsigned int b) { - return ((a1+a2)&5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */ + return ((a1+a2)&5) > b ? 2 : 3; /* { dg-bogus "changes signedness" } */ } int h(unsigned short a1, unsigned short a2, unsigned int b) { - return ((a1+a2)^5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */ + return ((a1+a2)^5) > b ? 2 : 3; /* { dg-bogus "changes signedness" } */ } -- cgit v1.1