c: Turn -Wimplicit-function-declaration into a permerror: Fix 'gcc.dg/gnu23-builtins-no-dfp-1.c' (was: [PATCH v3 06/11] c: Turn -Wimplicit-function-declaration into a permerror)

Message ID 87fs0luded.fsf@euler.schwinge.homeip.net
State Superseded
Headers
Series c: Turn -Wimplicit-function-declaration into a permerror: Fix 'gcc.dg/gnu23-builtins-no-dfp-1.c' (was: [PATCH v3 06/11] c: Turn -Wimplicit-function-declaration into a permerror) |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed

Commit Message

Thomas Schwinge Dec. 1, 2023, 3:54 p.m. UTC
  Hi!

On 2023-11-20T10:56:16+0100, Florian Weimer <fweimer@redhat.com> wrote:
> --- a/gcc/c/c-decl.cc
> +++ b/gcc/c/c-decl.cc

> @@ -3515,14 +3515,14 @@ implicit_decl_warning (location_t loc, tree id, tree olddecl)
>       {
>         gcc_rich_location richloc (loc);
>         richloc.add_fixit_replace (suggestion);
> -       warned = pedwarn (&richloc, OPT_Wimplicit_function_declaration,
> -                         "implicit declaration of function %qE;"
> -                         " did you mean %qs?",
> -                         id, suggestion);
> +       warned = permerror_opt (&richloc, OPT_Wimplicit_function_declaration,
> +                               "implicit declaration of function %qE;"
> +                               " did you mean %qs?",
> +                               id, suggestion);
>       }
>        else
> -     warned = pedwarn (loc, OPT_Wimplicit_function_declaration,
> -                       "implicit declaration of function %qE", id);
> +     warned = permerror_opt (loc, OPT_Wimplicit_function_declaration,
> +                             "implicit declaration of function %qE", id);
>      }

There's one more test case to adjust, for the more limited back ends
(here: 'target { ! dfp }').  OK to push the attached
"c: Turn -Wimplicit-function-declaration into a permerror: Fix 'gcc.dg/gnu23-builtins-no-dfp-1.c'"?


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
  

Patch

From 35ecfb7264bc93dbf2a5b2ee0a2d23a881fd6ded Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Fri, 1 Dec 2023 16:52:06 +0100
Subject: [PATCH] c: Turn -Wimplicit-function-declaration into a permerror: Fix
 'gcc.dg/gnu23-builtins-no-dfp-1.c'

With recent commit 55e94561e97ed0bce4774aa1c6b5d5d82209a379
"c: Turn -Wimplicit-function-declaration into a permerror", this test
case, added in 2019 commit 5b8d9367684f266c30c280b4d3c98830a88c70ab
"Prevent all uses of DFP when unsupported (PR c/91985)" started FAILing
(for applicable configurations):

    [-PASS:-]{+FAIL:+} gcc.dg/gnu23-builtins-no-dfp-1.c  (test for warnings, line 13)
    [-PASS:-]{+FAIL:+} gcc.dg/gnu23-builtins-no-dfp-1.c  (test for warnings, line 14)
    [-PASS:-]{+FAIL:+} gcc.dg/gnu23-builtins-no-dfp-1.c  (test for warnings, line 15)
    [-PASS:-]{+FAIL:+} gcc.dg/gnu23-builtins-no-dfp-1.c  (test for warnings, line 16)
    [-PASS:-]{+FAIL:+} gcc.dg/gnu23-builtins-no-dfp-1.c  (test for warnings, line 17)
    [-PASS:-]{+FAIL:+} gcc.dg/gnu23-builtins-no-dfp-1.c  (test for warnings, line 18)
    [-PASS:-]{+FAIL:+} gcc.dg/gnu23-builtins-no-dfp-1.c (test for excess errors)

This is due to:

    [...]/gcc.dg/gnu23-builtins-no-dfp-1.c:13:13: error: implicit declaration of function '__builtin_fabsd32'; did you mean '__builtin_fabsf32'? [-Wimplicit-function-declaration]
    [...]

Adjust as obvious.

	gcc/testsuite/
	* gcc.dg/gnu23-builtins-no-dfp-1.c: 'dg-error "implicit"' instead
	of 'dg-warning "implicit"'.
---
 gcc/testsuite/gcc.dg/gnu23-builtins-no-dfp-1.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/gnu23-builtins-no-dfp-1.c b/gcc/testsuite/gcc.dg/gnu23-builtins-no-dfp-1.c
index 9fa25f0dd13..7cb200fce6a 100644
--- a/gcc/testsuite/gcc.dg/gnu23-builtins-no-dfp-1.c
+++ b/gcc/testsuite/gcc.dg/gnu23-builtins-no-dfp-1.c
@@ -10,9 +10,9 @@  int nand32 (void);
 int nand64 (void);
 int nand128 (void);
 
-__typeof__ (__builtin_fabsd32 (0)) d32; /* { dg-warning "implicit" } */
-__typeof__ (__builtin_fabsd64 (0)) d64; /* { dg-warning "implicit" } */
-__typeof__ (__builtin_fabsd128 (0)) d128; /* { dg-warning "implicit" } */
-__typeof__ (__builtin_nand32 (0)) d32n; /* { dg-warning "implicit" } */
-__typeof__ (__builtin_nand64 (0)) d64n; /* { dg-warning "implicit" } */
-__typeof__ (__builtin_nand128 (0)) d128n; /* { dg-warning "implicit" } */
+__typeof__ (__builtin_fabsd32 (0)) d32; /* { dg-error "implicit" } */
+__typeof__ (__builtin_fabsd64 (0)) d64; /* { dg-error "implicit" } */
+__typeof__ (__builtin_fabsd128 (0)) d128; /* { dg-error "implicit" } */
+__typeof__ (__builtin_nand32 (0)) d32n; /* { dg-error "implicit" } */
+__typeof__ (__builtin_nand64 (0)) d64n; /* { dg-error "implicit" } */
+__typeof__ (__builtin_nand128 (0)) d128n; /* { dg-error "implicit" } */
-- 
2.34.1