j3-fortran / fortran_proposals

Proposals for the Fortran Standard Committee
178 stars 15 forks source link

Allow COMPILER_VERSION, COMPILER_OPTIONS in constant expressions #105

Open sblionel opened 4 years ago

sblionel commented 4 years ago

Fortran 2008 added COMPILER_VERSION and COMPILER_OPTIONS functions to intrinsic module ISO_FORTRAN_ENV, These are nice, but they can't be used in constant expressions, despite their being compile-time constant.

10.1.2 has a carve-out for transformational intrinsics from IEEE_ARITHMETIC and IEEE_EXCEPTIONS when all arguments are constant expressions. I would like to see this extended to ISO_FORTRAN_ENV

In addition, many users have asked for a way to save the compile date/time in the code. One can sometimes do this with a preprocessor, but a COMPILE_DATE_TIME or such function in ISO_FORTRAN_ENV would round out the existing support.

FortranFan commented 4 years ago

This issue is a candidate for #106.

jacobwilliams commented 4 years ago

I love the COMPILE_DATE_TIME idea!