bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Bruno Haible
Subject: Re: [PATCH] maint: enable the sc_avoid_if_before_free syntax-check
Date: Thu, 12 Jul 2012 12:56:34 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

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 before free" rule is less valuable nowadays
than a couple of years ago: It was a migration aid from K&R C to ANSI C.
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.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]