This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[fortran,patch] Add SELECTED_CHAR_KIND intrinsic
- From: FX <fxcoudert at gmail dot com>
- To: Fortran List <fortran at gcc dot gnu dot org>, "gcc-patches@@gcc.gnu.org patches" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 30 Apr 2008 17:30:33 +0200
- Subject: [fortran,patch] Add SELECTED_CHAR_KIND intrinsic
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; bh=53i9FJ7YO6FzLKVtNCy5aDgsayyN6PKWRsAu69QbNJ8=; b=hz+9TBDtggHHXVBvicAG6Ca6MHWkGZubIsjd3PLIIRLCODMimPs/NGVsm+wWOLNu753FUL+H4hfLa7JtYSUZqW5JHhpAhe1uexl52nKjlju0i/RUOcWO4kSZHSCxBNw3JbthiIqHcOWSPmczUMZQVwkD2rHX4ZmDVHfCeI+0fHM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=JoZqaZKhjzO3Q5+PQXiUzsyAGmXDRHIcehdcpSXWicrf8vBTMRea+wdGIQ++Lv2X26ni1xZWaeF9Vehty/hnSKD5XITUim+UZt517eTJVhcq66uUmNnHSJDlyK18VhNp7X9yfDdjgMc+JqhvKM1fdaDhmO1qOZ9dFDEooa7K/80=
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
Attachment:
selected_char_kind.ChangeLog
Description: Binary data
Attachment:
selected_char_kind.diff
Description: Binary data
--
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/