From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2888 invoked by alias); 13 Nov 2013 07:11: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 2855 invoked by uid 89); 13 Nov 2013 07:11:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Nov 2013 07:11:14 +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 rAD7B6qM008015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Nov 2013 02:11:06 -0500 Received: from localhost (ovpn-113-88.phx2.redhat.com [10.3.113.88]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAD7B4nt030870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Nov 2013 02:11:05 -0500 Received: by localhost (Postfix, from userid 1000) id B914F16503A; Wed, 13 Nov 2013 08:11:03 +0100 (CET) From: Dodji Seketeli To: Bernd Edlinger Cc: Jakub Jelinek , GCC Patches , Tom Tromey , Manuel =?utf-8?B?TMOzcGV6LUliw6HDsWV6?= Subject: Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals References: <20131031144309.GR27813@tucnak.zalov.cz> <87y559xz7y.fsf@redhat.com> <20131031173649.GW27813@tucnak.zalov.cz> <87zjpbb5qu.fsf@redhat.com> <20131111142159.GZ27813@tucnak.zalov.cz> <878uwuap4f.fsf@redhat.com> <878uwt63e2.fsf@redhat.com> X-URL: http://www.redhat.com Date: Wed, 13 Nov 2013 09:40:00 -0000 In-Reply-To: (Bernd Edlinger's message of "Wed, 13 Nov 2013 00:44:06 +0100") Message-ID: <877gcc4vzs.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-11/txt/msg01404.txt.bz2 Bernd Edlinger writes: >> + memmove (*line, l, len); >> + (*line)[len - 1] = '\0'; >> + *line_len = --len; > > Generally, I would prefer to use memcpy, > if it is clear that the memory does not overlap. I don't mind. I'll change that in my local copy. Thanks. > You copy one char too much and set it to zero? It's not one char too much. That char is the terminal '\n' in most cases. > Using -- on a value that goes out of scope looks > awkward IMHO. I don't understand this sentence. What do you mean by "Using -- on a value that goes out of scope"? -- Dodji