Re: [PATCH] maint: enable the sc_avoid_if_before_free syntax-check

2012-07-12 Thread Jim Meyering
Bruno Haible wrote: > Hi Jim, > >> > Nowadays little code remains that is written for K&R C, and few minds >> > program >> > for K&R C. Therefore the "if before free" cases that are remaining are >> > more likely to be intentional than before. >> >> If only that were true. I've just removed seve

Re: [PATCH] maint: enable the sc_avoid_if_before_free syntax-check

2012-07-12 Thread Bruno Haible
Hi Jim, > > Nowadays little code remains that is written for K&R C, and few minds > > program > > for K&R C. Therefore the "if before free" cases that are remaining are > > more likely to be intentional than before. > > If only that were true. I've just removed several hundreds of > such uses f

Re: [PATCH] maint: enable the sc_avoid_if_before_free syntax-check

2012-07-12 Thread Jim Meyering
Bruno Haible wrote: > Hi Jim, > >> Bruno, is it ok to remove the one in lib/clean-temp.c, below? > > No, it's better if the 'if (old_array != NULL)' stays there. It reminds > the maintainer of the code of the two possible cases. I'm surprised you think it's worth keeping that test solely as a rem

Re: [PATCH] maint: enable the sc_avoid_if_before_free syntax-check

2012-07-12 Thread Bruno Haible
Hi Jim, > Bruno, is it ok to remove the one in lib/clean-temp.c, below? No, it's better if the 'if (old_array != NULL)' stays there. It reminds the maintainer of the code of the two possible cases. So, can you please add clean-temp.c to if_before_free_offenders_ ? Note also that this "avoid if

[PATCH] maint: enable the sc_avoid_if_before_free syntax-check

2012-07-11 Thread Jim Meyering
ep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 11 Jul 2012 17:25:27 +0200 Subject: [PATCH] maint: enable the sc_avoid_if_before_free syntax-check rule * cfg.mk (local-checks-to-skip): Enable sc_avoid_if_before_free. (if_before_free_offenders_): Define. (if_before_free_basename_re_): Define