Next Up Previous Contents
Next: A.10 AC_FC_OPEN_SPECIFIERS
Up: A The Starconf macros and variables
Previous: A.8 AC_FC_HAVE_VOLATILE
[ID index][Keyword index]

A.9 AC_FC_LITERAL_BACKSLASH

AC_FC_LITERAL_BACKSLASH

Check whether the compiler regards the backslash character as an escape character. The backslash is not in the Fortran character set, so ISO-1539 does not specify how this is to be interpreted, but many Unix Fortran compilers interpret '\n', for example, as a newline, and '\\' as a single backslash. Many Unix compilers have switches which allow you to choose between these two modes.

This macro tests the behaviour of the currently selected compiler, and defines FC_LITERAL_BACKSLASH to 1 if backslashes are treated literally -- that is if '\\' is interpreted as a pair of backslashes and thus that '\n' is interpreted as a pair of characters rather than a newline.

Note that, if you simply want to have a character constant which contains a single backslash, then the following initialisation will do that for you without any need for this macro (thanks to Peter Draper).


*  Printable backslash: some compilers need '\\' to get '\', which
*  isn't a problem as Fortran will truncate the string '\\' to '\'
*  on the occasions when that isn't needed.
      CHARACTER * ( 1 ) CCD1__BKSLH
      PARAMETER ( CCD1__BKSLH = '\\' )
Fortran is required to truncate the initialising string without error, as noted in ISO-1539 sections 5.2.9 and 7.5.1.


Next Up Previous Contents
Next: A.10 AC_FC_OPEN_SPECIFIERS
Up: A The Starconf macros and variables
Previous: A.8 AC_FC_HAVE_VOLATILE
[ID index][Keyword index]
The Starlink Build System
Starlink System Note 78
Norman Gray, Peter W Draper, Mark B Taylor, Steven E Rankin
11 April 2005. Release snapshot: $Revision: 1.116 $. Last updated 28 May 2006