Fix usage of invalid BOZ integer constants#44
Fix usage of invalid BOZ integer constants#44albertziegenhagel wants to merge 1 commit intomicrosoft:masterfrom
Conversation
gfortran >= 10.0 started to emit an error for BOZ integer constants in invalid locations. This change replaces the hexadecimal integer constants by regular ones, so that msmpi fortran bindings can be consumed by gfortran without the need to pass `-fallow-invalid-boz`.
|
👍 Thanks for putting this fix together. I'm seeing the same issues with gfortran. |
|
Thank you. Currently there are a large volume of warnings emitted before this fix. Any way we can help expedite? |
|
@scivision @albertziegenhagel Do you know of a gfortran compiler flag or code pragma that will suppress this warning? I would like to silence this warning in my Appveyor CI. Thanks! |
When using MS-MPI's `mpif.h` with gfortran version 10+ there are many warnings of the form: ` warning : BOZ literal constant at (1) is neither a data-stmt-constant nor an actual argument to INT, REAL, DBLE, or CMPLX intrinsic function`. The eliminate these warnings convert the hex data types to integers. This extends the work started in microsoft#25. fixes microsoft#44
There was a problem hiding this comment.
It appears that this PR has existed for 4 years. Recently, I have also come across such warnings and discovered this repo. These warnings arise from the code writing not conforming to the Fortran standard, and they are frequently historical extensions of the Fortran compilers.
@albertziegenhagel, thank you for sharing!
| PARAMETER (MPI_OP_NULL=402653184) | ||
| INTEGER MPI_DATATYPE_NULL | ||
| PARAMETER (MPI_DATATYPE_NULL=z'0c000000') | ||
| PARAMETER (MPI_DATATYPE_NULL=201326592) |
There was a problem hiding this comment.
Another modification approach is PARAMETER (MPI_DATATYPE_NULL=int(z'0c000000')), because int is a built-in function, and compilation optimization makes it efficient. This modification might be easily reviewed.
Of course, directly updating to decimal is also good.
There was a problem hiding this comment.
If it is convenient, subsequent commits can also update the use of similar non-standard syntax in mpi.f90:
Microsoft-MPI/src/include/mpi.f90
Line 229 in f2d849f
There was a problem hiding this comment.
gfortran may throw out the following warning(s):
mpif.h:56:19:
Warning: Obsolescent feature: Old-style character length at (1)
mpif.h:57:19:
Warning: Obsolescent feature: Old-style character length at (1)The non-standard writing character*1 should be replaced with the standard writing character(1):
Microsoft-MPI/src/include/mpi.f90
Line 58 in f2d849f
Microsoft-MPI/src/include/mpif.h
Line 56 in f2d849f
gfortran >= 10.0 started to emit an error for BOZ integer constants in invalid locations. This change replaces the hexadecimal integer constants by regular ones, so that msmpi fortran bindings can be consumed by gfortran without the need to pass
-fallow-invalid-boz.Some amount of integer constants have already been replaced in #25.
edit: The conversions from the hexadecimal numbers to decimal numbers have been performed by a simple python script, so I hope there should not be any typos.