Tim Prince wrote:
As execute_command_line has been available in gfortran for over a year
without penetrating to commonly used targets (e.g. mingw-64), I
wondered if there is a suggestion for pre-processor macro to choose a
source code branch, such as keying on gcc version number.
I suppose if it were easy to back-port to gfortran 4.5, it would have
been done already.
GCC 4.7.0 (including "gfortran -cpp" and "cpp") set (cf. "gfortran -cpp
-dM test.F90"):
#define __GNUC__ 4
#define __GNUC_MINOR__ 7
The main reason that execute_command_line has not been backported to
older GCC versions is that it is not a regression and not a bug. (The
patch is not very small but rather localized.) Actually, I am surprised
that you are considering a backport: execute_command_line is a Fortran
2008 feature and very few compilers support it. On the other hand, the
vendor intrinsic SYSTEM (either as function or as subroutine - or as
with gfortran: both) is widely supported. (Besides the standard
conformance, the main advantage of execute_command_line is the support
of WAIT=.false., which is often not needed.)
Tobias