bits()
in bitset_type
returned a non-zero value even though no value is set.
#746
Labels
bug
Something isn't working
Description
The following code, built with gfortran, caught an error because a type-bound procedure
bits()
returns a non-zero value.Expected Behaviour
I expected
bits()
to return 0 since no value is set forset6
.Version of stdlib
b8fbb3c
Platform and Architecture
Windows 10 22H2 64bit, gfortran 11.2 bundled with quickstart Fortran on Windows
Additional Information
This error occurs when child types of
bitset_type
,bitset_large
andbitset_64
, are declared in ablock
construct, and the error is caused by the fact that the componentnum_bits
ofbitset_type
is not initialized to0
as the default value.The error can be fixed by setting the default value of
num_bits
to0
.The text was updated successfully, but these errors were encountered: