diff options
author | Robert Dewar <dewar@adacore.com> | 2006-02-17 17:08:58 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2006-02-17 17:08:58 +0100 |
commit | f813ac73e9991904d0aec7b4f59a12563b9882e3 (patch) | |
tree | fcb8e67153e45815b912e143e7e8ad5488633f81 | |
parent | dc6b9ba2d18ecc4b22e1a23002cea7681d8786bc (diff) | |
download | gcc-f813ac73e9991904d0aec7b4f59a12563b9882e3.zip gcc-f813ac73e9991904d0aec7b4f59a12563b9882e3.tar.gz gcc-f813ac73e9991904d0aec7b4f59a12563b9882e3.tar.bz2 |
s-wchcnv.adb: Document handling of [ on output (we do not change this to ["5B"] and the new...
2006-02-17 Robert Dewar <dewar@adacore.com>
* s-wchcnv.adb: Document handling of [ on output (we do not change
this to ["5B"] and the new comments say why not.
* gnat_ugn.texi:
Add note for -gnatVo that this now includes the cases of type
conversions and qualified expressions.
Add comments on handling of brackets encoding for Text_IO
From-SVN: r111198
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 3 | ||||
-rw-r--r-- | gcc/ada/s-wchcnv.adb | 19 |
2 files changed, 20 insertions, 2 deletions
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 96b0161..a3b21c3 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -5275,7 +5275,8 @@ Arguments for predefined operators and attributes are validity checked. This includes all operators in package @code{Standard}, the shift operators defined as intrinsic in package @code{Interfaces} and operands for attributes such as @code{Pos}. Checks are also made -on individual component values for composite comparisons. +on individual component values for composite comparisons, and on the +expressions in type conversions and qualified expressions. @item -gnatVp @emph{Validity checks for parameters.} diff --git a/gcc/ada/s-wchcnv.adb b/gcc/ada/s-wchcnv.adb index e3afa9c..ecbcb26c 100644 --- a/gcc/ada/s-wchcnv.adb +++ b/gcc/ada/s-wchcnv.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -411,9 +411,26 @@ package body System.WCh_Cnv is end if; when WCEM_Brackets => + + -- Values in the range 0-255 are directly output. Note that there + -- is some issue with [ (16#5B#] since this will cause confusion + -- if the resulting string is interpreted using brackets encoding. + + -- One possibility would be to always output [ as ["5B"] but in + -- practice this is undesirable, since for example normal use of + -- Wide_Text_IO for output (much more common than input), really + -- does want to be able to say something like + + -- Put_Line ("Start of output [first run]"); + + -- and have it come out as intended, rather than contaminated by + -- a ["5B"] sequence in place of the left bracket. + if Val < 256 then Out_Char (Character'Val (Val)); + -- Otherwise use brackets notation for vales greater than 255 + else Out_Char ('['); Out_Char ('"'); |