[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] maint: use pragma consistently across replacement header
Re: [PATCH 2/2] maint: use pragma consistently across replacement headers
Mon, 29 Mar 2010 10:13:20 -0600
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:126.96.36.199) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3
On 03/28/2010 04:35 AM, Bruno Haible wrote:
>>> Did you know that GCC has a special optimization for include files? ...
>> are you saying that the optimization is useless for those files, because they
>> are split includes, and thus already fail to meet the pattern that gcc
>> is looking for?
> No, on the contrary: The previous shape of most of our *.in.h files matches
> what GCC is looking for: It starts with a "#ifndef _GL_STRING_H" and ends
> with the corresponding "#endif". The fact that _GL_STRING_H is tested again
> inside is irrelevant for this optimization.
I think we're in violent agreement - for the few files with special
invocation (like fcntl.h), we cannot satisfy gcc's optimization anyway,
so we might as well guarantee the pragma is up front to avoid any issues
with conditional optimization; but for the remaining files, we might as
well satisfy gcc's optimization, since the effort is trivial.
> Here's the proposed patch:
> +++ lib/arpa_inet.in.h Sun Mar 28 12:07:53 2010
> @@ -16,12 +16,12 @@
> along with this program; if not, write to the Free Software Foundation,
> Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
> -# if __GNUC__ >= 3
> -# endif
> #ifndef _GL_ARPA_INET_H
> +#if __GNUC__ >= 3
Hmm, if we were using cppi more religiously, I wouldn't have introduced
the whitespace usage in that #if in the first place.
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
Description: OpenPGP digital signature