git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Johannes Sixt
Message 8 of 8 in “run-command.c: fix build warnings on Ubuntu”
  1. run-command.c: fix build warnings on UbuntuMichael Wookey, Jan 29, 2010
  2. Markus HeidelbergJan 30, 2010
  3. run-command: prettify -D_FORTIFY_SOURCE workaroundJonathan Nieder, Mar 16, 2011
  4. Junio C HamanoMar 16, 2011
  5. run-command: prettify -D_FORTIFY_SOURCE workaroundJonathan Nieder, Mar 16, 2011
  6. Junio C HamanoMar 17, 2011
  7. Johannes SixtMar 16, 2011
  8. Jonathan NiederMar 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.