public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fix PR ada/80888
@ 2017-05-27 18:35 Simon Wright
  2017-06-16 16:58 ` Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Wright @ 2017-05-27 18:35 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1347 bytes --]

The GNAT reference manual says in 11.6 Wide_Text_IO
<https://gcc.gnu.org/onlinedocs/gnat_rm/Wide_005fText_005fIO.html>,

  "The default encoding method for the standard files, and for opened
  files for which no WCEM parameter is given in the FORM string matches
  the wide character encoding specified for the main program (the
  default being brackets encoding if no coding method was specified with
  -gnatW)."

This is not true; the default is brackets encoding regardless of the
coding method specified with -gnatW.

The attached patch (to 7.1.0) corrects this. Tested on
x86_84-apple-darwin15 by rebuilding the library (cd gcc; make gnatlib
gnatlib-shared) and make -j4 check-ada,

		=== acats Summary ===
# of expected passes		2320
# of unexpected failures	0
/Volumes/Miscellaneous/tmp/gcc-7.1.0/gcc/testsuite/ada/acats/run_all.sh completed at Fri 26 May 2017 15:44:52 BST

		=== gnat Summary ===

# of expected passes		2569
# of expected failures		24
# of unsupported tests		7
/Volumes/Miscellaneous/tmp/gcc-7.1.0-build/gcc/gnatmake version 7.1.0

gcc/ada/Changelog:

	2017-05-27 Simon Wright <simon@pushface.org>

	PR ada/80888
	* a-textio.adb (Set_WCEM): default the file's wide character encoding
	  method to Default_WCEM, not WCEM_Brackets.
	* a-witeio.adb: likewise.
	* a-ztexio.adb: likewise.


[-- Attachment #2: wcem-fix.diff --]
[-- Type: application/octet-stream, Size: 1485 bytes --]

diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb
index f9219e3..8d22be8 100644
--- a/gcc/ada/a-textio.adb
+++ b/gcc/ada/a-textio.adb
@@ -1810,11 +1810,10 @@ package body Ada.Text_IO is
       Stop  : Natural;
 
    begin
-      File.WC_Method := WCEM_Brackets;
       FIO.Form_Parameter (File.Form.all, "wcem", Start, Stop);
 
       if Start = 0 then
-         File.WC_Method := WCEM_Brackets;
+         File.WC_Method := Default_WCEM;
 
       else
          if Stop = Start then
diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb
index 59e06e2..dbae077 100644
--- a/gcc/ada/a-witeio.adb
+++ b/gcc/ada/a-witeio.adb
@@ -1652,11 +1652,10 @@ package body Ada.Wide_Text_IO is
       Stop  : Natural;
 
    begin
-      File.WC_Method := WCEM_Brackets;
       FIO.Form_Parameter (File.Form.all, "wcem", Start, Stop);
 
       if Start = 0 then
-         File.WC_Method := WCEM_Brackets;
+         File.WC_Method := Default_WCEM;
 
       else
          if Stop = Start then
diff --git a/gcc/ada/a-ztexio.adb b/gcc/ada/a-ztexio.adb
index 6102942..aff7fe0 100644
--- a/gcc/ada/a-ztexio.adb
+++ b/gcc/ada/a-ztexio.adb
@@ -1626,11 +1626,10 @@ package body Ada.Wide_Wide_Text_IO is
       Stop  : Natural;
 
    begin
-      File.WC_Method := WCEM_Brackets;
       FIO.Form_Parameter (File.Form.all, "wcem", Start, Stop);
 
       if Start = 0 then
-         File.WC_Method := WCEM_Brackets;
+         File.WC_Method := Default_WCEM;
 
       else
          if Stop = Start then

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix PR ada/80888
  2017-05-27 18:35 [PATCH] fix PR ada/80888 Simon Wright
@ 2017-06-16 16:58 ` Simon Wright
  2017-06-18 13:08   ` Arnaud Charlet
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Wright @ 2017-06-16 16:58 UTC (permalink / raw)
  To: gcc-patches

Ping
If OK, can it be applied please?
(patch applies cleanly to current sources)

> On 27 May 2017, at 16:58, Simon Wright <simon@pushface.org> wrote:
> 
> The GNAT reference manual says in 11.6 Wide_Text_IO
> <https://gcc.gnu.org/onlinedocs/gnat_rm/Wide_005fText_005fIO.html>,
> 
>  "The default encoding method for the standard files, and for opened
>  files for which no WCEM parameter is given in the FORM string matches
>  the wide character encoding specified for the main program (the
>  default being brackets encoding if no coding method was specified with
>  -gnatW)."
> 
> This is not true; the default is brackets encoding regardless of the
> coding method specified with -gnatW.
> 
> The attached patch (to 7.1.0) corrects this. Tested on
> x86_84-apple-darwin15 by rebuilding the library (cd gcc; make gnatlib
> gnatlib-shared) and make -j4 check-ada,
> 
> 		=== acats Summary ===
> # of expected passes		2320
> # of unexpected failures	0
> /Volumes/Miscellaneous/tmp/gcc-7.1.0/gcc/testsuite/ada/acats/run_all.sh completed at Fri 26 May 2017 15:44:52 BST
> 
> 		=== gnat Summary ===
> 
> # of expected passes		2569
> # of expected failures		24
> # of unsupported tests		7
> /Volumes/Miscellaneous/tmp/gcc-7.1.0-build/gcc/gnatmake version 7.1.0
> 
> gcc/ada/Changelog:
> 
> 	2017-05-27 Simon Wright <simon@pushface.org>
> 
> 	PR ada/80888
> 	* a-textio.adb (Set_WCEM): default the file's wide character encoding
> 	  method to Default_WCEM, not WCEM_Brackets.
> 	* a-witeio.adb: likewise.
> 	* a-ztexio.adb: likewise.
> 
> <wcem-fix.diff>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix PR ada/80888
  2017-06-16 16:58 ` Simon Wright
@ 2017-06-18 13:08   ` Arnaud Charlet
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaud Charlet @ 2017-06-18 13:08 UTC (permalink / raw)
  To: Simon Wright; +Cc: gcc-patches

> Ping
> If OK, can it be applied please?
> (patch applies cleanly to current sources)

Patch is OK. I'll apply it when I get a chance.

Arno

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-18 13:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-27 18:35 [PATCH] fix PR ada/80888 Simon Wright
2017-06-16 16:58 ` Simon Wright
2017-06-18 13:08   ` Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).