Re: [PATCH] run-command: prettify -D_FORTIFY_SOURCE workaround

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

 



Johannes Sixt wrote:

> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]