min/max and string arguments

FX fxcoudert@gmail.com
Thu Jan 1 23:16:00 GMT 2009


> What should be the proper output of this code fragment?
>
> 	print *, MIN ("foo", "", "bar")
> 	end
>
> gfortran answers "bar"


If so, it's a recent change, since the version on my laptop gives the  
right answer (it's dated 20081211):

lumo /tmp $ cat a.f90
   write (*,"('#',A,'#')") MIN ("foo", "", "bar")
   end
lumo /tmp $ gfortran -v
Using built-in specs.
Target: i386-apple-darwin8.10.1
Configured with: /tmp/gfortran-20081211/ibin/../gcc/configure -- 
prefix=/usr/local/gfortran --enable-languages=c,fortran --with-gmp=/ 
tmp/gfortran-20081211/gfortran_libs --enable-bootstrap
Thread model: posix
gcc version 4.4.0 20081211 (experimental) [trunk revision 142675] (GCC)
lumo /tmp $ gfortran a.f90 && ./a.out
#   #


(I remember having thought about it quite a bit when working on  
widechar strings SELECT)

-- 
FX



More information about the Fortran mailing list