Re: [PATCH] run-command: prettify -D_FORTIFY_SOURCE workaround
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 16, 2011, 09:25 UTC
- Message-ID
- <20110316092526.GA7886@elie>
- In-Reply-To
- <4D80801A.1000208@viscovery.net>
Johannes Sixt wrote:
Show 8 quoted lines
> And what about compilers that warn: > > ';' : empty controlled statement found; is this the intent? > > That's from MSVC. Perhaps: > > if (write(...)) > (void)0; /* we know we are ignoring the error, mr gcc! */
Mm, thanks for pointing it out.
Your suggestion is part of a bigger change that imho should go in a separate patch:
$ git grep -F -e ' ; /*' origin/master | wc -l 65
I would prefer to see such a patch do
if (write(...)) {
/* ... explanation goes here ... */
}or something like
#define do_nothing() do { /* nothing */ } while (0)if (write(...)) do_nothing(); /* ... explanation ... */
but that is a small detail.