]> gcc.gnu.org Git - gcc.git/commitdiff
re PR ada/78531 (bootstrap broken with _FORTIFY_SOURCE enabled)
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 27 Nov 2016 20:23:31 +0000 (20:23 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 27 Nov 2016 20:23:31 +0000 (20:23 +0000)
PR ada/78531
* namet.h (Max_Line_Length): Define.
(struct Bounded_String): Declare Chars with exact size.
(namet__get_decoded_name_string): Delete.
(Get_Decoded_Name_String): Likewise.
(casing__set_all_upper_case): Likewise.

From-SVN: r242901

gcc/ada/ChangeLog
gcc/ada/namet.h

index ae124deb1f1dbb1e098e948f3e474f537894a561..d89b9674556c3441236cf608a99b71ae0087960a 100644 (file)
@@ -1,3 +1,12 @@
+2016-11-27  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR ada/78531
+       * namet.h (Max_Line_Length): Define.
+       (struct Bounded_String): Declare Chars with exact size.
+       (namet__get_decoded_name_string): Delete.
+       (Get_Decoded_Name_String): Likewise.
+       (casing__set_all_upper_case): Likewise.
+
 2016-11-22  Uros Bizjak  <ubizjak@gmail.com>
 
        * gcc-interface/Make-lang.in (check-acats): Fix detection
index 32d110b2d275ded53416b292b75818377406373f..a016f93b93d0124f84f5899d0435d6691503cdf2 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *            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- *
@@ -25,7 +25,7 @@
 
 /* This is the C file that corresponds to the Ada package specification
    Namet.  It was created manually from files namet.ads and namet.adb.
-   Some subprograms from Sinput are also made accessible here.  */
+   Subprograms from Exp_Dbug and Sinput are also made accessible here.  */
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,14 +52,15 @@ extern struct Name_Entry *Names_Ptr;
 #define Name_Chars_Ptr namet__name_chars__table
 extern char *Name_Chars_Ptr;
 
-/* The global name buffer. */
+/* This is Hostparm.Max_Line_Length.  */
+#define Max_Line_Length (32767 - 1)
+
+/* The global name buffer.  */
 struct Bounded_String
 {
   Nat Max_Length;
   Nat Length;
-  char Chars[1];
-  /* The 1 here is wrong, but it doesn't matter, because all the code either
-     goes by Length, or NUL-terminates the string before processing it. */
+  char Chars[4 * Max_Line_Length]; /* Exact value for overflow detection.  */
 };
 
 #define Global_Name_Buffer namet__global_name_buffer
@@ -81,32 +82,9 @@ Get_Name_String (Name_Id Id)
   return Name_Chars_Ptr + Names_Ptr[Id - First_Name_Id].Name_Chars_Index + 1;
 }
 
-/* Get_Decoded_Name_String returns a null terminated C string in the same
-   manner as Get_Name_String, except that it is decoded (i.e. upper half or
-   wide characters are put back in their external form, and character literals
-   are also returned in their external form (with surrounding apostrophes) */
-
-extern void namet__get_decoded_name_string (Name_Id);
-
-static char *Get_Decoded_Name_String (Name_Id);
-
-INLINE char *
-Get_Decoded_Name_String (Name_Id Id)
-{
-  namet__get_decoded_name_string (Id);
-  Name_Buffer[Name_Len] = 0;
-  return Name_Buffer;
-}
-
 #define Name_Equals namet__name_equals
 extern Boolean Name_Equals (Name_Id, Name_Id);
 
-/* Like Get_Decoded_Name_String, but the result has all qualification and
-   package body entity suffixes stripped, and also all letters are upper
-   cased.  This is used for building the enumeration literal table. */
-
-extern void casing__set_all_upper_case (void);
-
 /* The following routines and variables are not part of Namet, but we
    include the header here since it seems the best place for it.  */
 
This page took 0.06808 seconds and 5 git commands to generate.