This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran,documentation patch] Improve the documentation of GNU extensions


FX Coudert wrote:
+@node Integer-logical conversions
+@section Integer-logical conversions
+@cindex Integer-logical conversions
+
+@command{gfortran} allows integer-to-logical and logical-to-integer
+conversions.

Given the recent comp.lang.fortran thread, this should probably describe the conversions -- i.e., what range of integers are converted to which logical, and what integers result when a logical TRUE or FALSE are converted.


Also, do these conversions work with all sizes of integers and logicals?

Does this apply (without generating an error) even when -std=legacy is not declared? (I'm not immediately sure whether these are in a section that implies that all of these require -std=legacy or not, but I note that the goto-and-label-in-different-blocks section mentions the option explicitly.) If there is not at least a warning when this occurs under -std=gnu, I should like to complain, but that's not a matter for your patch! :)

+@node Non scalar character formats
+@section Non scalar character formats
+@cindex Non scalar character formats
+
+@command{gfortran} allows a character array to be used as in a
+@code{FORMAT} tag; the format is then understood as the concatenation of
+all the character strings of the array. The following example program
+@smallexample
+  character*4,parameter :: str(2) = (/ "(I5,", "A4) " /)
+  write (*,str) 12345, "6789"
+  end
+@end smallexample

This interpretation of character arrays in FORMAT statements is standard F95, not an extension. See 10.1.2, p. 162, lines 3-6 of the standard.


+outputs "123456789". Assigned Hollerith constants can also be used as
+@code{FORMAT} variables, when code is compiled with the
+@code{-std=legacy} option.

This, however, presumably is not standard F95, and should be described separately.


- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]