Re: [PATCH v3 06/11] c: Turn -Wimplicit-function-declaration into a permerror

2024-04-09 Thread Sam James
Sebastian Huber  writes:

> On 09.04.24 14:10, Sam James wrote:
>> Sebastian Huber  writes:
>> 
>>> On 20.11.23 10:56, Florian Weimer wrote:
 In the future, it may make sense to avoid cascading errors from
 the implicit declaration, especially its assumed int return type.
 This change here only changes the kind of the diagnostic, not
 its wording or consequences.
>>> Maybe this change should be added to the GCC 14 release notes.
>> Can you be more specific? Florian wrote about it in detail at
>> https://gcc.gnu.org/gcc-14/porting_to.html#c.
>> If you're referring specifically to the
>> cascade-affecting-diagnostics,
>> that change hasn't been made yet.
>> What am I missing?
>
> I searched for "implicit-function-declaration" at
>
> https://gcc.gnu.org/gcc-14/changes.html
>
> and found nothing. All right, the
>
> https://gcc.gnu.org/gcc-14/porting_to.html
>
> has a description, but this is one step away from the release
> notes. Maybe something like this could be added to the release notes:
>

I sympathise with the request. I note that we *did* mention -fno-common
at https://gcc.gnu.org/gcc-10/changes.html and just gave more detail at
https://gcc.gnu.org/gcc-10/porting_to.html. (I was pretty sure we hadn't
until I checked.)

Gerald?

> diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
> index ff69e859..90a14f37 100644
> --- a/htdocs/gcc-14/changes.html
> +++ b/htdocs/gcc-14/changes.html
> @@ -231,6 +231,17 @@ a work-in-progress.
>previous options -std=c2x, -std=gnu2x
>and -Wc11-c2x-compat, which are deprecated but remain
>supported.
> +  The following warnings are now errors (see also
> +Porting to GCC 14):
> +
> +  -Werror=declaration-missing-parameter-type
> +  -Werror=implicit-function-declaration
> +  -Werror=implicit-int
> +  -Werror=incompatible-pointer-types
> +  -Werror=int-conversion
> +  -Werror=return-mismatch
> +
> +  
>  
>
>  C++

thanks,
sam


Re: [PATCH v3 06/11] c: Turn -Wimplicit-function-declaration into a permerror

2024-04-09 Thread Sebastian Huber

On 09.04.24 14:10, Sam James wrote:

Sebastian Huber  writes:


On 20.11.23 10:56, Florian Weimer wrote:

In the future, it may make sense to avoid cascading errors from
the implicit declaration, especially its assumed int return type.
This change here only changes the kind of the diagnostic, not
its wording or consequences.

Maybe this change should be added to the GCC 14 release notes.


Can you be more specific? Florian wrote about it in detail at
https://gcc.gnu.org/gcc-14/porting_to.html#c.

If you're referring specifically to the cascade-affecting-diagnostics,
that change hasn't been made yet.

What am I missing?


I searched for "implicit-function-declaration" at

https://gcc.gnu.org/gcc-14/changes.html

and found nothing. All right, the

https://gcc.gnu.org/gcc-14/porting_to.html

has a description, but this is one step away from the release notes. 
Maybe something like this could be added to the release notes:


diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
index ff69e859..90a14f37 100644
--- a/htdocs/gcc-14/changes.html
+++ b/htdocs/gcc-14/changes.html
@@ -231,6 +231,17 @@ a work-in-progress.
   previous options -std=c2x, -std=gnu2x
   and -Wc11-c2x-compat, which are deprecated but remain
   supported.
+  The following warnings are now errors (see also
+Porting to GCC 14):
+
+  -Werror=declaration-missing-parameter-type
+  -Werror=implicit-function-declaration
+  -Werror=implicit-int
+  -Werror=incompatible-pointer-types
+  -Werror=int-conversion
+  -Werror=return-mismatch
+
+  
 

 C++

--
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


Re: [PATCH v3 06/11] c: Turn -Wimplicit-function-declaration into a permerror

2024-04-09 Thread Sam James
Sebastian Huber  writes:

> On 20.11.23 10:56, Florian Weimer wrote:
>> In the future, it may make sense to avoid cascading errors from
>> the implicit declaration, especially its assumed int return type.
>> This change here only changes the kind of the diagnostic, not
>> its wording or consequences.
> Maybe this change should be added to the GCC 14 release notes.

Can you be more specific? Florian wrote about it in detail at
https://gcc.gnu.org/gcc-14/porting_to.html#c.

If you're referring specifically to the cascade-affecting-diagnostics,
that change hasn't been made yet.

What am I missing?


Re: [PATCH v3 06/11] c: Turn -Wimplicit-function-declaration into a permerror

2024-04-09 Thread Sebastian Huber

On 20.11.23 10:56, Florian Weimer wrote:

In the future, it may make sense to avoid cascading errors from
the implicit declaration, especially its assumed int return type.
This change here only changes the kind of the diagnostic, not
its wording or consequences.

Maybe this change should be added to the GCC 14 release notes.

--
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


Re: [PATCH v3 06/11] c: Turn -Wimplicit-function-declaration into a permerror

2023-11-30 Thread Marek Polacek
On Mon, Nov 20, 2023 at 10:56:16AM +0100, Florian Weimer wrote:
> In the future, it may make sense to avoid cascading errors from
> the implicit declaration, especially its assumed int return type.
> This change here only changes the kind of the diagnostic, not
> its wording or consequences.

Looks fine.
 
> gcc/
> 
>   * doc/invoke.texi (Warning Options): Document changes.
> 
> gcc/c/
> 
>   PR c/91092
>   PR c/96284
>   * c-decl.cc (implicit_decl_permerror): Rename from
>   implicit_decl_warning.  Call permerror_opt instead of
>   pedwarn and warning_at.
>   (implicitly_declare): Adjust callers.
> 
> gcc/testsuite/
> 
>   * gcc.dg/permerror-default.c (implicit_function_declaration):
>   Expect the new permerror.
>   * gcc.dg/permerror-system.c: Likewise.
>   * c-c++-common/spellcheck-reserved.c (test, test_2): Expect
>   error instead of warning.
>   (f): Expect error instead of warning.
>   * gcc.dg/Wimplicit-function-declaration-c99.c: Compile with
>   -fpermissive due to expected warning.
>   * gcc.dg/Wimplicit-function-declaration-c99-2.c: New test.
>   Copied from gcc.dg/Wimplicit-function-declaration-c99.c.
>   Expect error.
>   * gcc.dg/missing-header-fixit-1.c: Compile with -fpermissive
>   due to expect error.
>   * gcc.dg/missing-header-fixit-1a.c: New test.  Copied from
>   gcc.dg/missing-header-fixit-1.c, but expect error.
>   * gcc.dg/missing-header-fixit-2.c: Compile with -fpermissive
>   due to expect error.
>   * gcc.dg/missing-header-fixit-2a.c: New test.  Copied from
>   gcc.dg/missing-header-fixit-2.c, but expect error.
>   * gcc.dg/missing-header-fixit-4.c: Compile with -fpermissive
>   due to expect error.
>   * gcc.dg/missing-header-fixit-4a.c: New test.  Copied from
>   gcc.dg/missing-header-fixit-4.c, but expect error.
>   * gcc.dg/missing-header-fixit-5.c: Compile with -fpermissive
>   due to expect error.
>   * gcc.dg/missing-header-fixit-5a.c: New test.  Copied from
>   gcc.dg/missing-header-fixit-5.c, but expect error.
>   * gcc.dg/pr61852.c: Expect implicit-function-declaration
>   error instead of warning.
>   * gcc.dg/spellcheck-identifiers-2.c: Compile with
>   -fpermissive due to expected warnings.
>   * gcc.dg/spellcheck-identifiers-2a.c: New test.  Copied
>   from gcc.dg/spellcheck-identifiers-2a.c.  Expect errors.
>   * gcc.dg/spellcheck-identifiers-3.c: Compile with
>   -fpermissive due to expected warnings.
>   * gcc.dg/spellcheck-identifiers-3a.c: New test.  Copied
>   from gcc.dg/spellcheck-identifiers-2a.c.  Expect errors.
>   * gcc.dg/spellcheck-identifiers-4.c: Compile with
>   -fpermissive due to expected warnings.
>   * gcc.dg/spellcheck-identifiers-4a.c: New test.  Copied
>   from gcc.dg/spellcheck-identifiers-2a.c.  Expect error.
>   * gcc.dg/spellcheck-identifiers.c: Compile with
>   -fpermissive due to expected warnings.
>   * gcc.dg/spellcheck-identifiers-1a.c: New test.  Copied
>   from gcc.dg/spellcheck-identifiers.c.  Expect errors.
>   * gcc.target/aarch64/sve/acle/general-c/ld1sh_gather_1.c (f1):
>   Expect error.
>   * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_index_1.c:
>   (f1): Likewise.
>   * 
> gcc.target/aarch64/sve/acle/general-c/load_ext_gather_index_restricted_1.c:
>   (f1): Likewise.
>   * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_1.c:
>   (f1): Likewise.
>   * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_2.c:
>   (f1): Likewise.
>   * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_3.c:
>   (f1): Likewise.
>   * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_4.c:
>   (f1): Likewise.
>   * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_5.c:
>   (f1): Likewise.
>   * 
> gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_1.c:
>   (f1): Likewise.
>   * 
> gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_2.c:
>   (f1): Likewise.
>   * 
> gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_3.c:
>   (f1): Likewise.
>   * 
> gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_4.c:
>   (f1): Likewise.
> ---
>  gcc/c/c-decl.cc   |  20 +--
>  gcc/doc/invoke.texi   |   8 +-
>  .../c-c++-common/spellcheck-reserved.c|   4 +-
>  .../Wimplicit-function-declaration-c99-2.c|   7 +
>  .../Wimplicit-function-declaration-c99.c  |   2 +-
>  gcc/testsuite/gcc.dg/missing-header-fixit-1.c |   2 +-
>  .../gcc.dg/missing-header-fixit-1a.c  |  37 +
>  gcc/testsuite/gcc.dg/missing-header-fixit-2.c |   2 +-
>  .../gcc.dg/missing-header-fixit-2a.c  |  31 
>  gcc/testsuite/gcc.dg/missing-header-fixit-4.c |   2