HDF-4.2.14 compilation error with GCC-10


Hi all.

HDF(4)-4.2.14 is not compiling with latest GNU compiler release 10.0.1 on Fedora Linux (devel branch):

/bin/sh ../../libtool  --tag=F77   --mode=compile gfortran  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules  -c -o mfgrff.lo ../../../hdf/src/mfgrff.f
libtool: compile:  gfortran -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -c ../../../hdf/src/mfgrff.f -o mfgrff.o
f951: Warning: '-Werror=' argument '-Werror=format-security' is not valid for Fortran
  132 |       mgsnatt = mgisattr(riid, name, nt, count, data, len(name))
      |                                                2
  155 |       mgsattr = mgisattr(riid, name, nt, count, data, len(name))
      |                                                1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(0)/INTEGER(4)).
make[3]: *** [Makefile:732: mfgrff.lo] Error 1

According to the GCC-10 release note, this type of error can be temporarily corrected by the flag -fallow-argument-mismatch as workaround.

Please, take a look before next HDF4 release.



Just hit this myself in trying out the newly stable and released GCC 10.1. If I pass in -fallow-argument-mismatch I do get a good compile.

Thanks @sagitter1 for posting this!