Re: [PATCH] Add -Wshadow-local and -Wshadow-compatible-local.

2016-10-24 Thread Jim Meyering
On Wed, Sep 14, 2016 at 5:49 AM, Mark Wielaard wrote: > On Wed, 2016-09-14 at 05:39 -0700, Ian Lance Taylor wrote: >> On Wed, Sep 14, 2016 at 1:30 AM, Mark Wielaard wrote: >> > On Wed, 2016-09-14 at 00:00 -0400, Jason Merrill wrote: >> >> I wonder about spelling the options as >> >> -Wshadow={loc

Re: [PATCH] Add -Wshadow-local and -Wshadow-compatible-local.

2016-09-12 Thread Jim Meyering
On Mon, Sep 12, 2016 at 7:05 AM, Eric Gallager wrote: > On 9/11/16, Manuel López-Ibáñez wrote: >> On 11/09/16 14:02, Mark Wielaard wrote: >>> -Wshadow-local which warns if a local variable shadows another local >>> variable or parameter, >>> >>> -Wshadow-compatible-local which warns if a lo

adding -Wshadow-local and -Wshadow-compatible-local ?

2015-12-11 Thread Jim Meyering
Hi Diego, I noticed this patch that adds support for improved -Wshadow-related options: [google] Add two new -Wshadow warnings (issue4452058) https://gcc.gnu.org/ml/gcc-patches/2011-04/msg02317.html https://codereview.appspot.com/4452058/ Here are the proposed descriptions: -Wshadow

Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Jim Meyering
Joseph S. Myers wrote: > On Tue, 29 May 2012, Jim Meyering wrote: > >> Running the following command spots over 1500 typos, and suggests fixes: >> >> $ git ls-files|misspellings -f -|grep -v '^ERROR:'|perl -pe \ >> 's/^(.*?)\[(\d+)\]: (\w+) -&g

Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Jim Meyering
Joseph S. Myers wrote: > I've applied this patch to fix what seemed to be some of the more > straightforward cases covered by gcc/ChangeLog. Thanks. I've run the same thing on gettext and reported the results upstream.

Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Jim Meyering
Arnaud Charlet wrote: >> Also note: the line numbers listed below work for me with yesterday's >> up-to-date trunk, but if you want to use these commands, you should rerun >> the commands above so that the line numbers reflect your actual sources. >> ) >> >> This is just a heads up. >> I'm not vol

Re: [PATCH] genattrtab: avoid NULL-deref on error

2012-04-24 Thread Jim Meyering
Richard Guenther wrote: > On Sat, Apr 21, 2012 at 5:53 PM, Jim Meyering wrote: >> I see that no one responded when I posted this in February. >> Ok to commit, now? > > Ok. Thanks. Pushed.

[PATCH] genattrtab: avoid NULL-deref on error

2012-04-21 Thread Jim Meyering
I see that no one responded when I posted this in February. Ok to commit, now? 2012-02-24 Jim Meyering * genattrtab.c (gen_attr): Avoid NULL-deref after diagnosing absence of an define_enum call. diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 4a4c2a2..bfbe3e8 100644

Re: [PATCH] genmodes: don't truncate a mode name of length >= 7

2012-04-20 Thread Jim Meyering
Richard Guenther wrote: > On Thu, Apr 19, 2012 at 10:35 PM, Jim Meyering wrote: >> Richard Guenther wrote: >>> Sure, my point was that the >>> >>>       if (strlen (m->name) >= sizeof buf) >>>         { >>>           error ("%s:

[PATCH] genmodes: don't truncate a mode name of length >= 7

2012-04-19 Thread Jim Meyering
xmalloc, which induces the single added free-before-continue. There was some clean-up along the way: "q" was easy to eliminate, and I pulled the two identical snprintf calls out of the "if" block and replaced them with the buf[0] assignment and memcpy. 2012-04-19 Jim Meyeri

Re: [PATCH] genmodes: remove misleading use of strncpy

2012-04-19 Thread Jim Meyering
Richard Guenther wrote: ... >>> The patch is ok with caching strlen and using memcpy. >> >> Like this, I presume: >> [alternatively, declare and compute m_len on a separate line, >>  just before the comparison: >>   size_t m_len = strlen (m->name); >>  I'd actually prefer that, but don't know if de

Re: [PATCH] genmodes: remove misleading use of strncpy

2012-04-19 Thread Jim Meyering
Richard Guenther wrote: > On Thu, Apr 19, 2012 at 2:13 PM, Jim Meyering wrote: >> Richard Guenther wrote: >>> On Thu, Apr 19, 2012 at 12:42 PM, Jim Meyering wrote: >>>> Found by inspection. >>>> Seeing this strncpy use without the usual following NUL-ter

Re: [PATCH] genmodes: remove misleading use of strncpy

2012-04-19 Thread Jim Meyering
Richard Guenther wrote: > On Thu, Apr 19, 2012 at 12:42 PM, Jim Meyering wrote: >> Found by inspection. >> Seeing this strncpy use without the usual following NUL-termination, >> my reflex was that it was a buffer overrun candidate, but then I >> realized this is gcc

[PATCH] genmodes: remove misleading use of strncpy

2012-04-19 Thread Jim Meyering
(buf, m->name, strlen (m->name) + 1). Ok to commit? 2012-04-19 Jim Meyering genmodes: remove misleading use of strncpy * genmodes.c (make_complex_modes): Avoid unnecessary use of strncpy. We verified above that the string(including trailing NUL) fits in buf,

[PATCH v2] genattrtab: avoid NULL-deref on error

2012-02-24 Thread Jim Meyering
This is the same as the preceding patch, but fixes s/defin_enum/define_enum/ in the ChangeLog comment: 2012-02-24 Jim Meyering * genattrtab.c (gen_attr): Avoid NULL-deref after diagnosing absence of an define_enum call. diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index

[PATCH] genattrtab: avoid NULL-deref on error

2012-02-24 Thread Jim Meyering
This fixes a coverity-spotted issue. A NULL "et" could be dereferenced after the diagnostic is issued. 2012-02-24 Jim Meyering genattrtab: avoid NULL-deref on error * genattrtab.c (gen_attr): Avoid NULL-deref after diagnosing absence of an defin_enum call.

Re: doubled words

2011-04-22 Thread Jim Meyering
Mike Stump wrote: > On Apr 10, 2011, at 2:07 PM, Jim Meyering wrote: >> $ git ls-files .|xargs perl -0777 -n -e 'while (/\b(it)\s+\1\b/gms)' >> -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print >> "$ARGV:$n:$v\n"}'|grep -v ChangeLog &g

unnecessary test before free changes committed

2011-04-20 Thread Jim Meyering
C_*_ variables are set to nonzero values in my environment) This was the culprit: FAIL: gcc.dg/matrix/transpose-3.c execution,-fprofile-use -fipa-matrix-reorg -fdump-ipa-matrix-reorg -O3 -fwhole-program -fno-tree-fre From 7e50b781d25170cf5bbe5f6247607c5dca879009 Mon Sep 17 00:00:00 2001 From

Re: [PATCH v3] Re: avoid useless if-before-free tests

2011-04-19 Thread Jim Meyering
Michael Matz wrote: > On Mon, 18 Apr 2011, Janne Blomqvist wrote: > >> (Why we, in the age of non-sucky version control, persist in keeping >> manual changelog files is beyond me..) > > The one single reason why I'm very happy about our ChangeLog file policy > is that I can grep it easily. Listing

Re: [PATCH] doubled words

2011-04-18 Thread Jim Meyering
Diego Novillo wrote: ... > Feel free to commit any of the patches in this series of typo fixes > you just posted. Thanks. Done, with this: From 7d5f43492809f2d96149853941bc8e0a9e7ecd10 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 18 Apr 2011 22:31:36 +0200 Subject: [PATCH] fix d

Re: [PATCH v4] Re: avoid useless if-before-free tests

2011-04-18 Thread Jim Meyering
Tom Tromey wrote: >>>>>> "Jim" == Jim Meyering writes: > > Jim> Since v3, I've rebased these and moved the fortran changes to precede > Jim> these (changing gfc_free to free introduced a few more instances > Jim> that this transformation dea

[PATCH v4] Re: avoid useless if-before-free tests

2011-04-18 Thread Jim Meyering
deal with a following "else", and another to restore a conditional that should not have been removed. A final(?) bootstrap and "make check" is running now. From d64b103b57c3785bb66a8c456ef4c0ec992f4852 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 3 Jan 2011 16:52:3

Re: [PATCH v3] Re: avoid useless if-before-free tests

2011-04-18 Thread Jim Meyering
Janne Blomqvist wrote: > On Mon, Apr 18, 2011 at 18:08, Jim Meyering wrote: >> I've rebased and divided/reordered these changes as you suggested. >> Here are the fortran parts.  I'll post the other parts separately. >> Parts 1 and 3 are manual.  Part 2 is the bi

Re: [PATCH] doubled words

2011-04-18 Thread Jim Meyering
Mike Stump wrote: > On Apr 16, 2011, at 4:04 AM, Gerald Pfeifer wrote: >> On Fri, 15 Apr 2011, Mike Stump wrote: >>> I think these are obvious. >> >> Which means that you can commit them without getting explicit approval > > Well, technically, it means nothing... It only means something if the >

Re: [PATCH v3] Re: avoid useless if-before-free tests

2011-04-18 Thread Jim Meyering
Janne Blomqvist wrote: > On Thu, Mar 24, 2011 at 18:51, Jim Meyering wrote: >> Janne Blomqvist wrote: >>> On Tue, Mar 8, 2011 at 19:53, Jim Meyering wrote: >>>> Relative to v2, I've added libgo/ to the list of exempt directories and >>>> added >

Re: [PATCH v3] Re: avoid useless if-before-free tests

2011-04-15 Thread Jim Meyering
> I added Jim to the gcc group. Thanks, Tom.

Re: [PATCH v3] Re: avoid useless if-before-free tests

2011-04-15 Thread Jim Meyering
Janne Blomqvist wrote: > On Fri, Apr 15, 2011 at 10:54, Jim Meyering wrote: >> Janne Blomqvist wrote: >> >>> On Thu, Mar 24, 2011 at 18:51, Jim Meyering wrote: >>>> Janne Blomqvist wrote: >>>>> On Tue, Mar 8, 2011 at 19:53, Jim Meyering wro

[PATCH] doubled words

2011-04-15 Thread Jim Meyering
Signed-off-by: Jim Meyering --- While most of these are in comments, the corrections in gcc/tree-cfg.c and gcc/config/sh/constraints.md are in strings. The former at least is marked for translation, and hence appears in every .po file. gcc/config/alpha/vms-unwind.h |4 ++-- gcc/config

Re: [PATCH v3] Re: avoid useless if-before-free tests

2011-04-15 Thread Jim Meyering
Janne Blomqvist wrote: > On Thu, Mar 24, 2011 at 18:51, Jim Meyering wrote: >> Janne Blomqvist wrote: >>> On Tue, Mar 8, 2011 at 19:53, Jim Meyering wrote: >>>> Relative to v2, I've added libgo/ to the list of exempt directories and >>>> added

Re: doubled words

2011-04-10 Thread Jim Meyering
Mike Stump wrote: > On Apr 10, 2011, at 4:54 AM, Jim Meyering wrote: >> I've noticed/fixed a few occurrences of doubled words like "the the", >> "to to" > > I fixed all the non-surious matches in the gcc/testsuite. if if in > the fortran testsui

Re: doubled words

2011-04-10 Thread Jim Meyering
Mike Stump wrote: > On Apr 10, 2011, at 4:54 AM, Jim Meyering wrote: >> I've noticed/fixed a few occurrences of doubled words like "the the", > > I've fixed the obviously wrong ones in gcc/.* excluding ada and go. I > don't hate Ada and go, since I d

doubled words

2011-04-10 Thread Jim Meyering
I've noticed/fixed a few occurrences of doubled words like "the the", "to to", etc. in other packages, so wrote this to find more of them: git ls-files|xargs perl -0777 -n \ -e 'while (/\b(then?|if|but|or|and|to)\s+\1\b/gms)' \ -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g;' \ -

Re: [PATCH v3] Re: avoid useless if-before-free tests

2011-03-24 Thread Jim Meyering
Janne Blomqvist wrote: > On Tue, Mar 8, 2011 at 19:53, Jim Meyering wrote: >> Relative to v2, I've added libgo/ to the list of exempt directories and added >> this recently discussed gfc_free patch, at the request of Tobias Burnus. >> Also, I corrected an error in fortr

Re: [PATCH gcc/fortran] get rid of gfc_free

2011-03-15 Thread Jim Meyering
Janne Blomqvist wrote: ... >> Hi Janne, >> >> These requested changes are in addition to (and independent of) >> the changes that I've already posted here. > > Yes, it was perhaps a bit unreasonable to ask you to fix this. OTOH > with your changes gfc_free() was just a wrapper around free() and > s

Re: [PATCH gcc/fortran] get rid of gfc_free

2011-03-15 Thread Jim Meyering
Jakub Jelinek wrote: > On Tue, Mar 15, 2011 at 11:02:38AM +0100, Jim Meyering wrote: >> > Instead of "please let us know", maybe recommend using >> > __builtin_expect instead? E.g. something like >> > >> > if (__builtin_expect (ptr != NULL,

[PATCH gcc/fortran] get rid of gfc_free

2011-03-15 Thread Jim Meyering
Janne Blomqvist wrote: > On Tue, Mar 8, 2011 at 19:53, Jim Meyering wrote: >> Relative to v2, I've added libgo/ to the list of exempt directories and added >> this recently discussed gfc_free patch, at the request of Tobias Burnus. >> Also, I corrected an error in fortr

Re: [PATCH v2] Re: avoid useless if-before-free tests

2011-03-08 Thread Jim Meyering
Rainer Orth wrote: > Jim Meyering writes: >>> the change at hand. And please don't change the alignment of entries >>> with multiple email addresses. >> >> Changing 8-spaces to a TAB does not affect alignment when you're >> looking at th

[PATCH v3] Re: avoid useless if-before-free tests

2011-03-08 Thread Jim Meyering
Jim Meyering wrote: > Joseph S. Myers wrote: > ... >> We definitely don't want to make local changes to zlib for this sort of >> issue, though importing a new upstream version of zlib (making sure the >> local configure code still works) should be fine for 4.7. >

Re: avoid useless if-before-free tests

2011-03-08 Thread Jim Meyering
Dr Andrew John Hughes wrote: > On 22:47 Mon 07 Mar , Joseph S. Myers wrote: >> On Mon, 7 Mar 2011, Dr Andrew John Hughes wrote: >> >> > > http://gcc.gnu.org/codingconventions.html says Classpath changes should >> > > go >> > > via Classpath upstream, not directly into GCC. I don't know if tha

Re: [PATCH v2] Re: avoid useless if-before-free tests

2011-03-08 Thread Jim Meyering
Rainer Orth wrote: > Jim Meyering writes: >> I've taken the liberty of letting my editor remove trailing >> blanks in ChangeLog files. I hope that's ok. Also in ChangeLogs, >> I converted some leading 8-space (and 7-space) sequences to single TABs. > > Pleas

[PATCH] avoid memory overrun in a test leading to potential double-free

2011-03-08 Thread Jim Meyering
expandargv.c:264) >From f60778ef0f07983b0ba72ed97fe52b687de28abb Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 8 Mar 2011 13:54:13 +0100 Subject: [PATCH] avoid memory overrun in a test leading to potential double-free * testsuite/test-expandargv.c (writeout_test): Fix off-by-one error: i.e., do copy the trailing NUL by

Re: avoid useless if-before-free tests

2011-03-08 Thread Jim Meyering
Joseph S. Myers wrote: Thank you for the prompt feedback. > On Sat, 5 Mar 2011, Jim Meyering wrote: > >> diff --git a/gcc/config/i386/gmm_malloc.h b/gcc/config/i386/gmm_malloc.h >> index 7a7e840..8993fc7 100644 >> --- a/gcc/config/i386/gmm_malloc.h >> +++

avoid useless if-before-free tests

2011-03-05 Thread Jim Meyering
e transformation of the 3rd. For the sake of bisection, at least those two should be combined. I'm all for combining all four, if you prefer. >From 0c74949d030103a9c33caaf5d753fe1bfe5792a5 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 3 Jan 2011 16:52:37 +0100 Subject: [PATCH 1/4