[fortran,patch] Add SELECTED_CHAR_KIND intrinsic

FX fxcoudert@gmail.com
Wed Apr 30 19:00:00 GMT 2008


Attached patch adds the Fortran 2003 SELECTED_CHAR_KIND intrinsic:  
front-end symbol, checking and simplifying routines, library routine,  
documentation and testcases (both valid and invalid code). This is  
really fairly straightforward. I include in that patch an unrelated  
diagnostics bug-fix: I realized that the following code

   integer, parameter :: k = 1
   print *, 42_k
   print *, k_"hello world"
   end

when compiled with -O2 -W -Wunused will give warnings that k is an  
unused parameter, which is not true. This is fixed by calling  
gfc_set_sym_referenced() on the appropriate kind value named  
constants right after they are successfully matched; this is done by  
two one-liners in primary.c.

Built on i386-apple-darwin8.10.1, will bootstrap and regtest on  
x86_64-linux as soon as I get back home (later today). OK to commit  
if it passes bootstrap and regtesting?

PS: Jerry, what's the status of ENCODING="..." I/O specifier? Can we  
already claim that we support Fortran 2003 international character  
sets (the requirements for that are fairly low, as quite a few  
compilers have a "yes" in that column and I know none that actually  
supports any nondefault character kind).

FX


-------------- next part --------------
A non-text attachment was scrubbed...
Name: selected_char_kind.ChangeLog
Type: application/octet-stream
Size: 1406 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080430/84c76302/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: selected_char_kind.diff
Type: application/octet-stream
Size: 21235 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080430/84c76302/attachment-0001.obj>
-------------- next part --------------


-- 
Fran?ois-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/


More information about the Fortran mailing list