testsuite: Adjust for the new permerror -Wincompatible-pointer-types

Message ID 20231206022931.33437-1-yangyujie@loongson.cn
State Accepted
Headers
Series testsuite: Adjust for the new permerror -Wincompatible-pointer-types |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Yang Yujie Dec. 6, 2023, 2:29 a.m. UTC
  r14-6037 turned -Wincompatible-pointer-types into a permerror,
which causes the following tests to fail.

gcc/testsuite/ChangeLog:

	* gcc.dg/fixed-point/composite-type.c: replace dg-warning with dg-error.
---
 .../gcc.dg/fixed-point/composite-type.c       | 64 +++++++++----------
 1 file changed, 32 insertions(+), 32 deletions(-)
  

Comments

Florian Weimer Dec. 6, 2023, 12:12 p.m. UTC | #1
* Yang Yujie:

> From: Yang Yujie <yangyujie@loongson.cn>
> Subject: [PATCH] testsuite: Adjust for the new permerror
>  -Wincompatible-pointer-types
> To: gcc-patches@gcc.gnu.org
> Cc: ro@CeBiTec.Uni-Bielefeld.DE, mikestump@comcast.net, fweimer@redhat.com,
>  Yang Yujie <yangyujie@loongson.cn>
> Date: Wed,  6 Dec 2023 10:29:31 +0800 (9 hours, 42 minutes, 7 seconds ago)
> Message-ID: <20231206022931.33437-1-yangyujie@loongson.cn>
>
> r14-6037 turned -Wincompatible-pointer-types into a permerror,
> which causes the following tests to fail.
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.dg/fixed-point/composite-type.c: replace dg-warning with dg-error.
> ---
>  .../gcc.dg/fixed-point/composite-type.c       | 64 +++++++++----------
>  1 file changed, 32 insertions(+), 32 deletions(-)

Looks reasonable to me, but I can't approve it.

Thanks,
Florian
  
Jeff Law Dec. 6, 2023, 5:45 p.m. UTC | #2
On 12/6/23 05:12, Florian Weimer wrote:
> * Yang Yujie:
> 
>> From: Yang Yujie <yangyujie@loongson.cn>
>> Subject: [PATCH] testsuite: Adjust for the new permerror
>>   -Wincompatible-pointer-types
>> To: gcc-patches@gcc.gnu.org
>> Cc: ro@CeBiTec.Uni-Bielefeld.DE, mikestump@comcast.net, fweimer@redhat.com,
>>   Yang Yujie <yangyujie@loongson.cn>
>> Date: Wed,  6 Dec 2023 10:29:31 +0800 (9 hours, 42 minutes, 7 seconds ago)
>> Message-ID: <20231206022931.33437-1-yangyujie@loongson.cn>
>>
>> r14-6037 turned -Wincompatible-pointer-types into a permerror,
>> which causes the following tests to fail.
>>
>> gcc/testsuite/ChangeLog:
>>
>> 	* gcc.dg/fixed-point/composite-type.c: replace dg-warning with dg-error.
>> ---
>>   .../gcc.dg/fixed-point/composite-type.c       | 64 +++++++++----------
>>   1 file changed, 32 insertions(+), 32 deletions(-)
> 
> Looks reasonable to me, but I can't approve it.
We might want to fix that from a policy standpoint :-)

Regardless, this is OK for the trunk.  Thanks Yang for taking care of 
it.  I don't see you in the maintainers file, so I'll go ahead and push 
it momentarily.

jeff
  
Yang Yujie Dec. 7, 2023, 1:30 a.m. UTC | #3
On Wed, Dec 06, 2023 at 10:45:22AM -0700, Jeff Law wrote:
> 
> 
> On 12/6/23 05:12, Florian Weimer wrote:
> > * Yang Yujie:
> > 
> > > From: Yang Yujie <yangyujie@loongson.cn>
> > > Subject: [PATCH] testsuite: Adjust for the new permerror
> > >   -Wincompatible-pointer-types
> > > To: gcc-patches@gcc.gnu.org
> > > Cc: ro@CeBiTec.Uni-Bielefeld.DE, mikestump@comcast.net, fweimer@redhat.com,
> > >   Yang Yujie <yangyujie@loongson.cn>
> > > Date: Wed,  6 Dec 2023 10:29:31 +0800 (9 hours, 42 minutes, 7 seconds ago)
> > > Message-ID: <20231206022931.33437-1-yangyujie@loongson.cn>
> > > 
> > > r14-6037 turned -Wincompatible-pointer-types into a permerror,
> > > which causes the following tests to fail.
> > > 
> > > gcc/testsuite/ChangeLog:
> > > 
> > > 	* gcc.dg/fixed-point/composite-type.c: replace dg-warning with dg-error.
> > > ---
> > >   .../gcc.dg/fixed-point/composite-type.c       | 64 +++++++++----------
> > >   1 file changed, 32 insertions(+), 32 deletions(-)
> > 
> > Looks reasonable to me, but I can't approve it.
> We might want to fix that from a policy standpoint :-)
> 
> Regardless, this is OK for the trunk.  Thanks Yang for taking care of it.  I
> don't see you in the maintainers file, so I'll go ahead and push it
> momentarily.
> 
> jeff

Thanks for the review!

With this patch, I also noticed a few errors in building unpatched older
software like expect-5.45.4, perl-5.28.3 and bash-5.0.  Will this also be
the case when GCC 14 gets released?

Thanks,
Yujie
  
Sam James Dec. 7, 2023, 1:35 a.m. UTC | #4
Yang Yujie <yangyujie@loongson.cn> writes:

> On Wed, Dec 06, 2023 at 10:45:22AM -0700, Jeff Law wrote:
>> 
>> 
>> On 12/6/23 05:12, Florian Weimer wrote:
>> > * Yang Yujie:
>> > 
>> > > From: Yang Yujie <yangyujie@loongson.cn>
>> > > Subject: [PATCH] testsuite: Adjust for the new permerror
>> > >   -Wincompatible-pointer-types
>> > > To: gcc-patches@gcc.gnu.org
>> > > Cc: ro@CeBiTec.Uni-Bielefeld.DE, mikestump@comcast.net, fweimer@redhat.com,
>> > >   Yang Yujie <yangyujie@loongson.cn>
>> > > Date: Wed,  6 Dec 2023 10:29:31 +0800 (9 hours, 42 minutes, 7 seconds ago)
>> > > Message-ID: <20231206022931.33437-1-yangyujie@loongson.cn>
>> > > 
>> > > r14-6037 turned -Wincompatible-pointer-types into a permerror,
>> > > which causes the following tests to fail.
>> > > 
>> > > gcc/testsuite/ChangeLog:
>> > > 
>> > > 	* gcc.dg/fixed-point/composite-type.c: replace dg-warning with dg-error.
>> > > ---
>> > >   .../gcc.dg/fixed-point/composite-type.c       | 64 +++++++++----------
>> > >   1 file changed, 32 insertions(+), 32 deletions(-)
>> > 
>> > Looks reasonable to me, but I can't approve it.
>> We might want to fix that from a policy standpoint :-)
>> 
>> Regardless, this is OK for the trunk.  Thanks Yang for taking care of it.  I
>> don't see you in the maintainers file, so I'll go ahead and push it
>> momentarily.
>> 
>> jeff
>
> Thanks for the review!
>
> With this patch, I also noticed a few errors in building unpatched older
> software like expect-5.45.4, perl-5.28.3 and bash-5.0.  Will this also be
> the case when GCC 14 gets released?
>

Old versions of software will need to be patched or built with
-fpermissive. We are working on fixing supported versions of software
and sending patches upstream - please do join in if you're able, as
the more help the better.

It is normal for software to need porting to newer compilers. For
example, https://gcc.gnu.org/gcc-10/porting_to.html (-fcommon).

> Thanks,
> Yujie

thanks,
sam
  
Yang Yujie Dec. 7, 2023, 1:42 a.m. UTC | #5
On Thu, Dec 07, 2023 at 01:35:23AM +0000, Sam James wrote:
> 
> Yang Yujie <yangyujie@loongson.cn> writes:
> 
> > On Wed, Dec 06, 2023 at 10:45:22AM -0700, Jeff Law wrote:
> >> 
> >> 
> >> On 12/6/23 05:12, Florian Weimer wrote:
> >> > * Yang Yujie:
> >> > 
> >> > > From: Yang Yujie <yangyujie@loongson.cn>
> >> > > Subject: [PATCH] testsuite: Adjust for the new permerror
> >> > >   -Wincompatible-pointer-types
> >> > > To: gcc-patches@gcc.gnu.org
> >> > > Cc: ro@CeBiTec.Uni-Bielefeld.DE, mikestump@comcast.net, fweimer@redhat.com,
> >> > >   Yang Yujie <yangyujie@loongson.cn>
> >> > > Date: Wed,  6 Dec 2023 10:29:31 +0800 (9 hours, 42 minutes, 7 seconds ago)
> >> > > Message-ID: <20231206022931.33437-1-yangyujie@loongson.cn>
> >> > > 
> >> > > r14-6037 turned -Wincompatible-pointer-types into a permerror,
> >> > > which causes the following tests to fail.
> >> > > 
> >> > > gcc/testsuite/ChangeLog:
> >> > > 
> >> > > 	* gcc.dg/fixed-point/composite-type.c: replace dg-warning with dg-error.
> >> > > ---
> >> > >   .../gcc.dg/fixed-point/composite-type.c       | 64 +++++++++----------
> >> > >   1 file changed, 32 insertions(+), 32 deletions(-)
> >> > 
> >> > Looks reasonable to me, but I can't approve it.
> >> We might want to fix that from a policy standpoint :-)
> >> 
> >> Regardless, this is OK for the trunk.  Thanks Yang for taking care of it.  I
> >> don't see you in the maintainers file, so I'll go ahead and push it
> >> momentarily.
> >> 
> >> jeff
> >
> > Thanks for the review!
> >
> > With this patch, I also noticed a few errors in building unpatched older
> > software like expect-5.45.4, perl-5.28.3 and bash-5.0.  Will this also be
> > the case when GCC 14 gets released?
> >
> 
> Old versions of software will need to be patched or built with
> -fpermissive. We are working on fixing supported versions of software
> and sending patches upstream - please do join in if you're able, as
> the more help the better.
> 
> It is normal for software to need porting to newer compilers. For
> example, https://gcc.gnu.org/gcc-10/porting_to.html (-fcommon).
> 
> > Thanks,
> > Yujie
> 
> thanks,
> sam

Got it, thanks.

Yujie
  
Florian Weimer Dec. 7, 2023, 9:18 a.m. UTC | #6
* Yang Yujie:

> With this patch, I also noticed a few errors in building unpatched older
> software like expect-5.45.4, perl-5.28.3 and bash-5.0.  Will this also be
> the case when GCC 14 gets released?

For Fedora, we keep pointers of the changes needed here:

  <https://gitlab.com/fweimer-rh/fedora-modernc/-/blob/main/pkg/b/bash.md>
  <https://gitlab.com/fweimer-rh/fedora-modernc/-/blob/main/pkg/e/expect.md>
  <https://gitlab.com/fweimer-rh/fedora-modernc/-/blob/main/pkg/p/perl.md>

(For perl, it looks like another change will be needed.)

This also includes changes that we imported through rebases after we
started tracking.

We do not have control over the release schedule for those upstream
projects, and of course there are many project which are more or less
dormant and have not made a release in many years.

Thanks,
Florian
  
Yang Yujie Dec. 8, 2023, 2 a.m. UTC | #7
On Thu, Dec 07, 2023 at 10:18:47AM +0100, Florian Weimer wrote:
> * Yang Yujie:
> 
> > With this patch, I also noticed a few errors in building unpatched older
> > software like expect-5.45.4, perl-5.28.3 and bash-5.0.  Will this also be
> > the case when GCC 14 gets released?
> 
> For Fedora, we keep pointers of the changes needed here:
> 
>   <https://gitlab.com/fweimer-rh/fedora-modernc/-/blob/main/pkg/b/bash.md>
>   <https://gitlab.com/fweimer-rh/fedora-modernc/-/blob/main/pkg/e/expect.md>
>   <https://gitlab.com/fweimer-rh/fedora-modernc/-/blob/main/pkg/p/perl.md>
> 
> (For perl, it looks like another change will be needed.)
> 
> This also includes changes that we imported through rebases after we
> started tracking.
> 
> We do not have control over the release schedule for those upstream
> projects, and of course there are many project which are more or less
> dormant and have not made a release in many years.
> 
> Thanks,
> Florian

Got it.  Thanks for the pointers to the fedora patches.

Yujie
  

Patch

diff --git a/gcc/testsuite/gcc.dg/fixed-point/composite-type.c b/gcc/testsuite/gcc.dg/fixed-point/composite-type.c
index 59351ff09b3..f91e480bcbf 100644
--- a/gcc/testsuite/gcc.dg/fixed-point/composite-type.c
+++ b/gcc/testsuite/gcc.dg/fixed-point/composite-type.c
@@ -68,39 +68,39 @@  FIXED_POINT_COMPOSITE_DECL(_Sat unsigned long long _Accum, Sullk);  /* { dg-erro
 
 int main()
 {
-  FIXED_POINT_COMPOSITE_TEST(short _Fract, sf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Fract, f);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(long _Fract, lf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(long long _Fract, llf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(unsigned short _Fract, usf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(unsigned _Fract, uf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(unsigned long _Fract, ulf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(unsigned long long _Fract, ullf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat short _Fract, Ssf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat _Fract, Sf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat long _Fract, Slf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat long long _Fract, Sllf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned short _Fract, Susf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned _Fract, Suf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long _Fract, Sulf);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long long _Fract, Sullf);  /* { dg-warning "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(short _Fract, sf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Fract, f);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(long _Fract, lf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(long long _Fract, llf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(unsigned short _Fract, usf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(unsigned _Fract, uf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(unsigned long _Fract, ulf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(unsigned long long _Fract, ullf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat short _Fract, Ssf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat _Fract, Sf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat long _Fract, Slf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat long long _Fract, Sllf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned short _Fract, Susf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned _Fract, Suf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long _Fract, Sulf);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long long _Fract, Sullf);  /* { dg-error "incompatible pointer type" } */
 
-  FIXED_POINT_COMPOSITE_TEST(short _Accum, sk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Accum, k);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(long _Accum, lk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(long long _Accum, llk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(unsigned short _Accum, usk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(unsigned _Accum, uk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(unsigned long _Accum, ulk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(unsigned long long _Accum, ullk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat short _Accum, Ssk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat _Accum, Sk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat long _Accum, Slk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat long long _Accum, Sllk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned short _Accum, Susk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned _Accum, Suk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long _Accum, Sulk);  /* { dg-warning "incompatible pointer type" } */
-  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long long _Accum, Sullk);  /* { dg-warning "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(short _Accum, sk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Accum, k);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(long _Accum, lk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(long long _Accum, llk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(unsigned short _Accum, usk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(unsigned _Accum, uk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(unsigned long _Accum, ulk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(unsigned long long _Accum, ullk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat short _Accum, Ssk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat _Accum, Sk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat long _Accum, Slk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat long long _Accum, Sllk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned short _Accum, Susk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned _Accum, Suk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long _Accum, Sulk);  /* { dg-error "incompatible pointer type" } */
+  FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long long _Accum, Sullk);  /* { dg-error "incompatible pointer type" } */
 
   return 0;
 }