From patchwork Sun Nov 27 20:23:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 84342 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp876616qgi; Sun, 27 Nov 2016 12:24:07 -0800 (PST) X-Received: by 10.98.25.205 with SMTP id 196mr18438964pfz.46.1480278247265; Sun, 27 Nov 2016 12:24:07 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y2si52499905pfk.286.2016.11.27.12.24.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 12:24:07 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-442739-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-442739-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-442739-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=BOdQJipLiC8vzmsq nLUXs/Ih1NQafiqJvvZD2aUB5CYpzCiCqxV8cfYxAnxV4EtHOPQBwk4ix7nwwlUa bqiaFClY0YI9ojWzOyQpFR5XQNUnVAP9IEsdda50EOoImZSDzY9WI/oeZC4ptDMF BPhbr27Ezy+JNBqE7quL75yP5N8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=FD003hRQWpPHuci1N363Ea 5B6X8=; b=SNSzCPgj7IqlCLGwhxnGmtCrfeDw/qQOcwfdqtxMuCNVao9EbE4DGX icnCWXPAgHC6vNLdBLuTRX/z+EPeyMECqHaM3xmQtoMmsxbxdqlu1UQC1DdC16rt OPZvWYqV05uwa03H1T/36sP/9J4MbxKJZNt0b3j1lKkNx+VrwbGnk= Received: (qmail 116533 invoked by alias); 27 Nov 2016 20:23:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 116519 invoked by uid 89); 27 Nov 2016 20:23:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=19922016, 1992-2016, name_len, letters X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 27 Nov 2016 20:23:42 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 13215812F8 for ; Sun, 27 Nov 2016 21:23:40 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CtTyXAAtp5sl for ; Sun, 27 Nov 2016 21:23:40 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id E0861812F5 for ; Sun, 27 Nov 2016 21:23:39 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix PR ada/78531 Date: Sun, 27 Nov 2016 21:23:39 +0100 Message-ID: <3908295.4BBI7GVTWI@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-48-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 This is the bootstrap failure on the mainline with _FORTIFY_SOURCE enabled. Fixed thusly, tested on x86_64-suse-linux, applied on the mainline. 2016-11-27 Eric Botcazou 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. -- Eric Botcazou Index: namet.h =================================================================== --- namet.h (revision 242863) +++ namet.h (working copy) @@ -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. */