Hi Harald,
in +++ b/gcc/fortran/symbol.cc
@@ -4624,12 +4624,28 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
there is
+ else if (!pedantic)
+ gfc_warning (0, "Derive ...
To me the "not pedantic" is counter-intuitive. In pedantic mode I would have
expected this to be at least a warning (if not an error). Why is it not flagged
at all? May be I expect something wrong from "pedantic".
Besides that: Looks good to me.
Regards,
Andre
On Sun, 2 Mar 2025 22:35:47 +0100
Harald Anlauf <[email protected]> wrote:
> Dear all,
>
> due to an oversight in the Fortran standard before 2018,
> empty derived types with bind(C) attribute were explicitly
> (deliberately?) accepted by gfortran, giving a warning that
> the companion processor might not provide an interoperating
> entity.
>
> In the PR, Tobias pointed to a discussion on the J3 ML that
> there was a defect in older standards. The attached patch
> now generates an error when -std=f20xx is specified, and
> continues to generate a warning otherwise.
>
> Regtested on x86_64-pc-linux-gnu. OK for mainline?
>
> Thanks,
> Harald
>
--
Andre Vehreschild * Email: vehre ad gmx dot de