Re: [PATCH] PR fortran/50549 - should detect different type parameters in structure constructors

2022-03-29 Thread Harald Anlauf via Gcc-patches
Hi Tobias, Am 29.03.22 um 09:14 schrieb Tobias Burnus: Hi Harald, On 28.03.22 22:03, Harald Anlauf via Fortran wrote: All current cases of printing a HOST_WIDE_INT in gcc/fortran/ use 'sprintf', and I did not find any other use of %wd/%wu.  So the mentioned implementation is not really

Re: [PATCH] PR fortran/50549 - should detect different type parameters in structure constructors

2022-03-29 Thread Tobias Burnus
Hi Harald, On 28.03.22 22:03, Harald Anlauf via Fortran wrote: All current cases of printing a HOST_WIDE_INT in gcc/fortran/ use 'sprintf', and I did not find any other use of %wd/%wu. So the mentioned implementation is not really stressed yet... ;-) That's all your fault ;-) (Your commit

Re: [PATCH] PR fortran/50549 - should detect different type parameters in structure constructors

2022-03-28 Thread Joseph Myers
On Mon, 28 Mar 2022, Harald Anlauf via Gcc-patches wrote: > Hi Tobias, > > sorry for replying to myself now, but > > Am 28.03.22 um 22:03 schrieb Harald Anlauf via Fortran: > > All current cases of printing a HOST_WIDE_INT in gcc/fortran/ use > > 'sprintf', and I did not find any other use of

Re: [PATCH] PR fortran/50549 - should detect different type parameters in structure constructors

2022-03-28 Thread Harald Anlauf via Gcc-patches
Hi Tobias, sorry for replying to myself now, but Am 28.03.22 um 22:03 schrieb Harald Anlauf via Fortran: All current cases of printing a HOST_WIDE_INT in gcc/fortran/ use 'sprintf', and I did not find any other use of %wd/%wu.  So the mentioned implementation is not really stressed yet... ;-)

Re: [PATCH] PR fortran/50549 - should detect different type parameters in structure constructors

2022-03-28 Thread Harald Anlauf via Gcc-patches
Hi Tobias, Am 28.03.22 um 12:05 schrieb Tobias Burnus: Thanks for the patch! LGTM and I think GCC 12 is still okay. However, I have a nit: --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -1375,11 +1375,22 @@ resolve_structure_cons (gfc_expr *expr, int init) ... +   long

Re: [PATCH] PR fortran/50549 - should detect different type parameters in structure constructors

2022-03-28 Thread Tobias Burnus
Hi Harald, On 27.03.22 21:44, Harald Anlauf via Fortran wrote: when assigning character pointers, we have a check for same length, which however does not trigger for character pointers within a structure constructor. The attached patch extends the character checks slightly to fix this

[PATCH] PR fortran/50549 - should detect different type parameters in structure constructors

2022-03-27 Thread Harald Anlauf via Gcc-patches
Dear all, when assigning character pointers, we have a check for same length, which however does not trigger for character pointers within a structure constructor. The attached patch extends the character checks slightly to fix this loophole. I've verified that NAG and Crayftn behave similarly,