aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 14:01:32 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 14:01:32 +0200
commitbac865a217a819eb5cf90af6962904241168f167 (patch)
tree749056594c0f63c918c4588fddb18fca5ccd6e3b
parent321c24f75dde674402481f1df0025c8169aa9cdd (diff)
downloadgcc-bac865a217a819eb5cf90af6962904241168f167.zip
gcc-bac865a217a819eb5cf90af6962904241168f167.tar.gz
gcc-bac865a217a819eb5cf90af6962904241168f167.tar.bz2
Code clenups.
From-SVN: r247193
-rw-r--r--gcc/ada/bindgen.adb2
-rw-r--r--gcc/ada/gnatchop.adb4
-rw-r--r--gcc/ada/s-dimmks.ads7
-rw-r--r--gcc/ada/s-wchcnv.adb2
-rw-r--r--gcc/ada/sinput.adb4
-rw-r--r--gcc/ada/sinput.ads4
-rw-r--r--gcc/ada/styleg.adb9
7 files changed, 21 insertions, 11 deletions
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index 5544c82..fff65d2 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -2717,7 +2717,7 @@ package body Bindgen is
-- every file, then we could use the encoding of the initial specified
-- file, but this information is passed only for potential main
-- programs. We could fix this sometime, but it is a very minor point
- -- (wide character default encoding for [Wide_[Wide_]Text_IO when there
+ -- (wide character default encoding for [Wide_[Wide_]]Text_IO when there
-- is no main program).
elsif No_Main_Subprogram then
diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb
index c638c45..c627602 100644
--- a/gcc/ada/gnatchop.adb
+++ b/gcc/ada/gnatchop.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2016, 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- --
@@ -1424,7 +1424,7 @@ procedure Gnatchop is
-- Test for presence of BOM
- Read_BOM (Buffer.all, BOM_Length, BOM, False);
+ Read_BOM (Buffer.all, BOM_Length, BOM, XML_Support => False);
BOM_Present := BOM /= Unknown;
-- Only chop those units that come from this file
diff --git a/gcc/ada/s-dimmks.ads b/gcc/ada/s-dimmks.ads
index 48771d0..1b131c4 100644
--- a/gcc/ada/s-dimmks.ads
+++ b/gcc/ada/s-dimmks.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2011-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-2016, 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- --
@@ -186,6 +186,11 @@ package System.Dim.Mks is
Ampere => -1,
others => 0);
+ -- Note the type punning below. The Symbol is a single "ohm" character
+ -- encoded in UTF-8 (ce a9 in hexadecimal), but this file is not compiled
+ -- with -gnatW8, so we're treating the string literal as a two-character
+ -- String.
+
subtype Electric_Resistance is Mks_Type
with
Dimension => (Symbol => "Ω",
diff --git a/gcc/ada/s-wchcnv.adb b/gcc/ada/s-wchcnv.adb
index 7e2ab08..07ccc5c 100644
--- a/gcc/ada/s-wchcnv.adb
+++ b/gcc/ada/s-wchcnv.adb
@@ -406,7 +406,7 @@ package body System.WCh_Cnv is
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
+ -- is an 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
diff --git a/gcc/ada/sinput.adb b/gcc/ada/sinput.adb
index 4b47757..4d0cbdd 100644
--- a/gcc/ada/sinput.adb
+++ b/gcc/ada/sinput.adb
@@ -272,11 +272,13 @@ package body Sinput is
Tst (J) := C;
end loop;
- Read_BOM (Tst, Len, BOM, False);
+ Read_BOM (Tst, Len, BOM, XML_Support => False);
case BOM is
when UTF8_All =>
Scan_Ptr := Scan_Ptr + Source_Ptr (Len);
+ First_Non_Blank_Location := Scan_Ptr;
+ Current_Line_Start := Scan_Ptr;
Wide_Character_Encoding_Method := WCEM_UTF8;
Upper_Half_Encoding := True;
diff --git a/gcc/ada/sinput.ads b/gcc/ada/sinput.ads
index 8165a8f..ef7f388 100644
--- a/gcc/ada/sinput.ads
+++ b/gcc/ada/sinput.ads
@@ -560,8 +560,8 @@ package Sinput is
-- the start of the current source. If the current source starts with a
-- recognized BOM, then some flags such as Wide_Character_Encoding_Method
-- are set accordingly, and the Scan_Ptr on return points past this BOM.
- -- An error message is output and Unrecoverable_Error raised if a non-
- -- recognized BOM is detected. The call has no effect if no BOM is found.
+ -- An error message is output and Unrecoverable_Error raised if an
+ -- unrecognized BOM is detected. The call has no effect if no BOM is found.
function Get_Column_Number (P : Source_Ptr) return Column_Number;
-- The ones-origin column number of the specified Source_Ptr value is
diff --git a/gcc/ada/styleg.adb b/gcc/ada/styleg.adb
index 58fd3fd..f785205 100644
--- a/gcc/ada/styleg.adb
+++ b/gcc/ada/styleg.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, 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- --
@@ -492,10 +492,13 @@ package body Styleg is
-- Start of processing for Check_Comment
begin
- -- Can never have a non-blank character preceding the first minus
+ -- Can never have a non-blank character preceding the first minus.
+ -- The "+ 3" is to leave room for a possible byte order mark (BOM);
+ -- we want to avoid a warning for a comment at the start of the
+ -- file just after the BOM.
if Style_Check_Comments then
- if Scan_Ptr > Source_First (Current_Source_File)
+ if Scan_Ptr > Source_First (Current_Source_File) + 3
and then Source (Scan_Ptr - 1) > ' '
then
Error_Msg_S -- CODEFIX