From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35550 invoked by alias); 30 May 2019 19:13:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 35541 invoked by uid 89); 30 May 2019 19:13:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=Wouldn't, Wouldnt, HX-Languages-Length:1811 X-HELO: mail-wr1-f46.google.com Received: from mail-wr1-f46.google.com (HELO mail-wr1-f46.google.com) (209.85.221.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 May 2019 19:13:13 +0000 Received: by mail-wr1-f46.google.com with SMTP id n4so1852189wrs.3 for ; Thu, 30 May 2019 12:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:in-reply-to:references:mime-version:content-transfer-encoding :subject:to:cc:from:message-id; bh=FI5kcbAW4H17gPttEf5tpG7+7GRlCWY/YMhrdVpfYo4=; b=GqajB9AKBZDxUsKNRLYTKbGz4lbTeqWI3jFlkAf0BNlCqqQvSJtLSBFOrVVvS2lW7x VIzVqT8vedICK06KKw5qThAHqqzxILT2yOokriWLo2HUYasASWOEy6aHZoSSIvNgerx9 8nGaMyWZ68xGybM300AsDbFyQYDSEcXbzMAwlhbPP7XU1eFwqcauIgmTx7uG56GJPMLq VQJbltLumYzWscbT1ql7yA9btXBIVdehttBMprO6omOL1X4HoJCfs/kN9JA3rHJrIKrl pKEBcor+KpDBf5rkt6L8i9o/m6e4Gh27sR0MTdkZPZCanb8afeFEnSGE/qdN7woDIyMY qzzQ== Return-Path: Received: from [192.168.1.132] (217-149-170-202.nat.highway.telekom.at. [217.149.170.202]) by smtp.gmail.com with ESMTPSA id o3sm889019wmo.6.2019.05.30.12.13.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 May 2019 12:13:10 -0700 (PDT) Date: Thu, 30 May 2019 19:20:00 -0000 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH][Preprocessor]patch to fix PR 90581 To: Qing Zhao ,David Malcolm CC: gcc Patches From: Bernhard Reutner-Fischer Message-ID: <18B02683-0BD4-4B3C-A7A9-38C0294349FB@gmail.com> X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg02042.txt.bz2 On 30 May 2019 18:23:43 CEST, Qing Zhao wrote: >Hi, > >PR 90581 (provide an option to adjust the maximum depth of nested >#include) >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90581 > >is to add a new cpp option -fmax-inlcude-depth Typo inl vs inc. Why isn't this a param? Wouldn't a param ease range checking not to overflow the uint max and maybe= automagically provide diagnostics for out of range input? In the docs you mix "number" and "depth". thanks, > to set the maximum depth >of nested #include. > >'-fmax-include-depth=3DDEPTH' > Set the maximum depth of the nested include. The default value is > 200. > >Please check the attached patch. >I have done bootstrap and regression test on X86, no any issue. > >thanks a lot. > >Qing. > > > >gcc/ChangeLog: > >2019-05-30 qing zhao > > * doc/cppopts.texi: Add document for -fmax-include-depth. > * doc/invoke.texi (Preprocessor Options): List -fmax-include-depth. > >libcpp/ChangeLog: > >2019-05-30 qing zhao > > * directives.c (do_include_common): Replace CPP_STACK_MAX with > CPP_OPTION (pfile, max_include_depth). > * include/cpplib.h (struct cpp_options): Add new field > max_include_depth. > * init.c (cpp_create_reader): Initiate new field max_include_depth. > * internal.h: Delete CPP_STACK_MAX. > >gcc/c-family/ChangeLog: > >2019-05-30 qing zhao > > * c-opts.c (c_common_handle_option): Handle -fmax-include-depth. > * c.opt: Add new option -fmax-include-depth. > >gcc/testsuite/ChangeLog: > >2019-05-30 qing zhao > > * c-c++-common/cpp/fmax-include-depth-1a.h: New test. > * c-c++-common/cpp/fmax-include-depth-1b.h: New test. > * c-c++-common/cpp/fmax-include-depth.c: New test.