Hi Steve,
On 1/22/20 4:02 PM, Steve Kargl wrote:
On Wed, Jan 22, 2020 at 11:59:12AM +0100, Tobias Burnus wrote:
And, additionally, about missing diagnostic related to (2) bind(c) and
kind=4,
Are you sure there is a missing diagnostic? You need to
add -Wc-binding-type or -Wall to your command line.
The problem with the ISO C warnings for character is that they are not
based on the KIND value but whether the variable comes from the
ISO_C_BINDING module or not.
Namely, for kind=1 and kind=4 you get the warning you have shown while
for kind=c_char and kind=c_int32_t you don't. (If you use "integer,
parameter :: mykind = c_char", the result is the same as for c_char as
this property is inherited.)
Numerically, 1 and c_char are the same – as are 4 and c_int32_t. I think
one *can* warn for using kind=1 as this is bad style (= assumption that
c_char is the same as "1" and the same as the default-kind character).
But "kind=4" is as bad as "kind=c_int32_t"! — And as noted in the PR,
using c_char and c_int32_t (!) will give a "character(kind=1)" (note the
kind=1!) dummy argument while kind=1 and kind=4 will give
"character(kind={1 or 4})[1:1]" (= ARRAY_TYPE).
That's complete nonsense and in some cases it does not even depend on
whether that's a BIND(C) procedure or not!
Cheers,
Tobias