From patchwork Wed Apr 20 10:29:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 612618 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qqdS72hJYz9s5l for ; Wed, 20 Apr 2016 20:30:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=CI6kVJTs; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=GX79CBnOr+n62cbI7cu5SatWkKDz4hvYyzACfQ5RpgcHmN362b OQnV/SJXvMKQ54llOkxTnURrUqscdPpUdfNdeYgvamrmQv+e+mJpbGcjbfnry2Q3 tmNhwHOV9SaI45xqvOxZRn06+b6faPkOgclDA6CKQ2B+4kZgsPOoo1Ku0= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=Rs/gzKL+CaCAupXvBChxPw96eWQ=; b=CI6kVJTsx+brtxWMzIlW RKmGDmFE4WHUEn77NQD+6SUXsf6XVSX4XdZJFP1tzi/aiCz4Tm/bblLI97tX4+we bM1wh9EhIJr54TsPepPFVgwFmoFTV1nRLILGTlcvXn9D4dGeuZinJ4D2cqI+lmdV RwlSmNLV9X7XSWmPYUidnmk= Received: (qmail 39513 invoked by alias); 20 Apr 2016 10:29:58 -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 39294 invoked by uid 89); 20 Apr 2016 10:29:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.3 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=Schonberg, schonbergadacorecom, schonberg@adacore.com, schonberg X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 20 Apr 2016 10:29:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 918AD116B95; Wed, 20 Apr 2016 06:29:43 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zU8lq2RH7vpp; Wed, 20 Apr 2016 06:29:43 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 81FED116B86; Wed, 20 Apr 2016 06:29:43 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4192) id 80FE217F; Wed, 20 Apr 2016 06:29:43 -0400 (EDT) Date: Wed, 20 Apr 2016 06:29:43 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Ed Schonberg Subject: [Ada] Missing style warning on overlong line is task subunit Message-ID: <20160420102943.GA129683@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) This patch restores a warning message on an overlong line in a subunit that is a task body, when compiling the parent unit. Compiling: gcc -c -gnatyM50 par.adb must yield: par-separated_task.adb:6:51: (style) this line is too long --- opackage Par is task type Separated_Task is entry Start; end Separated_Task; end Par; --- package body Par is task body Separated_Task is separate; end Par; --- separate (Par) task body Separated_Task is procedure Other is begin ----------------------------------------------------------- Too long null; end Other; begin accept Start; Other; end Separated_Task; Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-20 Ed Schonberg * sem.adb (Do_Analyze): Save and restore Style_Max_Line_Length so that the corresponding checks are preserved across compilations that include System.Constants in their context. Index: sem.adb =================================================================== --- sem.adb (revision 235192) +++ sem.adb (working copy) @@ -53,6 +53,7 @@ with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Stand; use Stand; +with Stylesw; use Stylesw; with Uintp; use Uintp; with Uname; use Uname; @@ -1316,6 +1317,13 @@ procedure Do_Analyze is Save_Ghost_Mode : constant Ghost_Mode_Type := Ghost_Mode; + -- Generally style checks are preserved across compilations, with + -- one exception: s-oscons.ads, which allows arbitrary long lines + -- unconditionally, and has no restore mechanism, because it is + -- intended as a lowest-level Pure package. + + Save_Max_Line : constant Int := Style_Max_Line_Length; + List : Elist_Id; begin @@ -1346,6 +1354,7 @@ Pop_Scope; Restore_Scope_Stack (List); Ghost_Mode := Save_Ghost_Mode; + Style_Max_Line_Length := Save_Max_Line; end Do_Analyze; -- Local variables