From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14172 invoked by alias); 24 Jan 2014 16:13:41 -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 14160 invoked by uid 89); 24 Jan 2014 16:13:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Jan 2014 16:13:39 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0OGDch3027590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 Jan 2014 11:13:38 -0500 Received: from tucnak.zalov.cz (vpn1-6-95.ams2.redhat.com [10.36.6.95]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0OGDZXt004209 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jan 2014 11:13:37 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.7/8.14.7) with ESMTP id s0OGDZGU024765; Fri, 24 Jan 2014 17:13:35 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.7/8.14.7/Submit) id s0OGDYKT024764; Fri, 24 Jan 2014 17:13:34 +0100 Date: Fri, 24 Jan 2014 16:13:00 -0000 From: Jakub Jelinek To: Dodji Seketeli Cc: Markus Trippelsdorf , Bernd Edlinger , GCC Patches , Tom Tromey , Manuel =?iso-8859-1?B?TPNwZXotSWLh8WV6?= Subject: Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals Message-ID: <20140124161334.GR892@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <878uwuap4f.fsf@redhat.com> <878uwt63e2.fsf@redhat.com> <20131113081610.GH27813@tucnak.zalov.cz> <87zjp7t73c.fsf@redhat.com> <87vbxcig8t.fsf@redhat.com> <20140124150532.GB396@x4> <87iot9qtff.fsf@redhat.com> <20140124154419.GQ892@tucnak.redhat.com> <878uu5qs3q.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878uu5qs3q.fsf@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg01593.txt.bz2 On Fri, Jan 24, 2014 at 05:09:29PM +0100, Dodji Seketeli wrote: > * input.c (read_line_num): Gracefully handle non-file locations or > empty caches. > > diff --git a/gcc/input.c b/gcc/input.c > index 547c177..b05e1da 100644 > --- a/gcc/input.c > +++ b/gcc/input.c > @@ -600,7 +600,8 @@ static bool > read_line_num (fcache *c, size_t line_num, > char ** line, ssize_t *line_len) > { > - gcc_assert (line_num > 0); > + if (!c || line_num < 1) > + return false; > > if (line_num <= c->line_num) > { Ok. > --- /dev/null > +++ b/gcc/testsuite/c-c++-common/cpp/warning-zero-location.c > @@ -0,0 +1,6 @@ > +/* > + { dg-options "-D _GNU_SOURCE" } > + { dg-do compile } > + */ > + > +#define _GNU_SOURCE /* { dg-warning "redefined" } */ I doubt this would fail without the patch though, because fno-diagnostics-show-caret is added by default to flags. So, I'd say you need also -fdiagnostics-show-caret in dg-options to reproduce it. Jakub