From 1e3d475ea16e89332e07651d61b60b408e0a0932 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Mon, 24 Jun 2019 15:47:22 +0000 Subject: [PATCH] utils.c (handle_nonnull_attribute): Quote attribute name. gcc/ada/ChangeLog: * gcc-interface/utils.c (handle_nonnull_attribute): Quote attribute name. gcc/c/ChangeLog: * c-typeck.c (build_binary_op): Hyphenate floating-point. gcc/testsuite/ChangeLog: * gcc.dg/Wfloat-equal-1.c: Adjust text of expected diagnostic. * gcc.dg/misc-column.c: Ditto. gcc/ChangeLog: * tree-pretty-print.h: Remove unnecessary punctuation characters from a diagnostic. * tree-ssa.c (release_defs_bitset): Correct preprocessor conditional. From-SVN: r272619 --- gcc/ChangeLog | 6 ++++++ gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/utils.c | 15 ++++++++------- gcc/c/ChangeLog | 4 ++++ gcc/c/c-typeck.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/Wfloat-equal-1.c | 8 ++++---- gcc/testsuite/gcc.dg/misc-column.c | 2 +- gcc/tree-pretty-print.h | 2 +- gcc/tree-ssa.c | 2 +- 10 files changed, 36 insertions(+), 15 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85c286a..942c6fd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-06-24 Martin Sebor + + * tree-pretty-print.h: Remove unnecessary punctuation characters + from a diagnostic. + * tree-ssa.c (release_defs_bitset): Correct preprocessor conditional. + 2019-06-24 Jonathan Wakely * ginclude/float.h (FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1b6aa2f..c85a4f7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-06-24 Martin Sebor + + * gcc-interface/utils.c (handle_nonnull_attribute): Quote attribute + name. + 2019-06-18 Arnaud Charlet PR ada/80590 diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index d9c9209..f2cb773 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -6234,7 +6234,8 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), && (!TYPE_ATTRIBUTES (type) || !lookup_attribute ("type generic", TYPE_ATTRIBUTES (type)))) { - error ("nonnull attribute without arguments on a non-prototype"); + error ("%qs attribute without arguments on a non-prototype", + "nonnull"); *no_add_attrs = true; } return NULL_TREE; @@ -6248,8 +6249,8 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), if (!get_nonnull_operand (TREE_VALUE (args), &arg_num)) { - error ("nonnull argument has invalid operand number (argument %lu)", - (unsigned long) attr_arg_num); + error ("%qs argument has invalid operand number (argument %lu)", + "nonnull", (unsigned long) attr_arg_num); *no_add_attrs = true; return NULL_TREE; } @@ -6270,8 +6271,8 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), if (!argument || TREE_CODE (argument) == VOID_TYPE) { - error ("nonnull argument with out-of-range operand number " - "(argument %lu, operand %lu)", + error ("%qs argument with out-of-range operand number " + "(argument %lu, operand %lu)", "nonnull", (unsigned long) attr_arg_num, (unsigned long) arg_num); *no_add_attrs = true; return NULL_TREE; @@ -6279,8 +6280,8 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), if (TREE_CODE (argument) != POINTER_TYPE) { - error ("nonnull argument references non-pointer operand " - "(argument %lu, operand %lu)", + error ("%qs argument references non-pointer operand " + "(argument %lu, operand %lu)", "nonnull", (unsigned long) attr_arg_num, (unsigned long) arg_num); *no_add_attrs = true; return NULL_TREE; diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 103634e..83f3eaa 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,7 @@ +2019-06-24 Martin Sebor + + * c-typeck.c (build_binary_op): Hyphenate floating-point. + 2019-06-10 Jakub Jelinek * c-parser.c (c_parser_pragma): Reject PRAGMA_OMP_SCAN. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 6abfd10..6419ca9 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -11939,7 +11939,7 @@ build_binary_op (location_t location, enum tree_code code, if (FLOAT_TYPE_P (type0) || FLOAT_TYPE_P (type1)) warning_at (location, OPT_Wfloat_equal, - "comparing floating point with %<==%> or % is unsafe"); + "comparing floating-point with %<==%> or % is unsafe"); /* Result of comparison is always int, but don't convert the args to int! */ build_type = integer_type_node; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 86865a8..041a81a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-24 Martin Sebor + + * gcc.dg/Wfloat-equal-1.c: Adjust text of expected diagnostic. + * gcc.dg/misc-column.c: Ditto. + 2019-06-23 Ian Lance Taylor * go.test/test/blank1.go: Update for diagnostic message changes. diff --git a/gcc/testsuite/gcc.dg/Wfloat-equal-1.c b/gcc/testsuite/gcc.dg/Wfloat-equal-1.c index 36b3fa5..1b23611 100644 --- a/gcc/testsuite/gcc.dg/Wfloat-equal-1.c +++ b/gcc/testsuite/gcc.dg/Wfloat-equal-1.c @@ -4,7 +4,7 @@ double a, b; _Complex double c, d; -int f(void) { return a == b; } /* { dg-warning "comparing floating point" } */ -int g(void) { return c == d; } /* { dg-warning "comparing floating point" } */ -int h(void) { return a != b; } /* { dg-warning "comparing floating point" } */ -int i(void) { return c != d; } /* { dg-warning "comparing floating point" } */ +int f(void) { return a == b; } /* { dg-warning "comparing floating-point" } */ +int g(void) { return c == d; } /* { dg-warning "comparing floating-point" } */ +int h(void) { return a != b; } /* { dg-warning "comparing floating-point" } */ +int i(void) { return c != d; } /* { dg-warning "comparing floating-point" } */ diff --git a/gcc/testsuite/gcc.dg/misc-column.c b/gcc/testsuite/gcc.dg/misc-column.c index e68300b..7dc6e58 100644 --- a/gcc/testsuite/gcc.dg/misc-column.c +++ b/gcc/testsuite/gcc.dg/misc-column.c @@ -13,7 +13,7 @@ extern void bar(); void foo (void) { - if (a == b) /* { dg-warning "9:comparing floating point with" } */ + if (a == b) /* { dg-warning "9:comparing floating-point with" } */ bar (); if (p < q) /* { dg-warning "9:comparison of distinct pointer types" } */ diff --git a/gcc/tree-pretty-print.h b/gcc/tree-pretty-print.h index 9f59328..5434e80 100644 --- a/gcc/tree-pretty-print.h +++ b/gcc/tree-pretty-print.h @@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "pretty-print.h" #define pp_unsupported_tree(PP, T) \ - pp_verbatim (PP, "#%qs not supported by %s#", \ + pp_verbatim (PP, "%qs not supported by %s", \ get_tree_code_name (TREE_CODE (T)), __FUNCTION__) #define pp_ti_abstract_origin(TI) ((tree *) (TI)->x_data) diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 4b6fa44..16eaa8e 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -631,7 +631,7 @@ release_defs_bitset (bitmap toremove) the verification errors. Their format strings don't follow GCC diagnostic conventions and the calls are ultimately followed by one to internal_error. */ -#if __GNUC__ > 10 +#if __GNUC__ >= 10 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wformat-diag" #endif -- 2.7.4