Do not build with -Winline
Commit Message
Per the previous discussion.
Comments
Florian Weimer wrote:
> Per the previous discussion.
This patch looks good to me. In other GNU projects we've found that -Winline is
more trouble than it's worth. Like -Wunsafe-loop-optimizations, all that
-Winline tells you is that generated code is not quite as efficient as it might
be under ideal conditions, which is not a big deal, certainly not worth breaking
a build over.
On 04/24/2015 05:01 PM, Paul Eggert wrote:
> Florian Weimer wrote:
>> Per the previous discussion.
>
> This patch looks good to me. In other GNU projects we've found that
> -Winline is more trouble than it's worth. Like
> -Wunsafe-loop-optimizations, all that -Winline tells you is that
> generated code is not quite as efficient as it might be under ideal
> conditions, which is not a big deal, certainly not worth breaking a
> build over.
Thanks, committed.
It's even worse, -Winline warns for cases where the code is, in fact,
optimal (not inlining a non-trivial function called multiple times from
unlikely code is often beneficial).
From 69372f19d39ac6cf3570cbf62ae4610a26c15e41 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 24 Apr 2015 11:10:24 +0200
Subject: [PATCH] Do not build with -Winline
-Winline causes architecture- and optimization-dependent build failures
due to -Werror. -Winline warns about inlining decisions based on
branch hints, in effect preventing the use of inline functions in
header files (because they might be called on unlikely branches, leading
to a decision not to inline).
The option was apparently added to the glibc build at a time when GCC
did not support the always_inline attribute. With current GCC versions,
inlining failure for functions declared always_inline will receive a
warning under -Wattributes, which is enabled by default, so -Winline
appears unnecessary.
---
ChangeLog | 4 ++++
Makeconfig | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
@@ -1,3 +1,7 @@
+2015-04-24 Florian Weimer <fweimer@redhat.com>
+
+ * Makeconfig (+gccwarn): Remove -Winline.
+
2015-04-22 Wilco Dijkstra <wdijkstr@arm.com>
* math/k_casinh.c (__kernel_casinh): Use __copysign.
@@ -739,9 +739,9 @@ endif
# Extra flags to pass to GCC.
ifeq ($(all-warnings),yes)
-+gccwarn := -Wall -Wwrite-strings -Winline -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
++gccwarn := -Wall -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
else
-+gccwarn := -Wall -Wwrite-strings -Winline
++gccwarn := -Wall -Wwrite-strings
endif
+gccwarn += -Wundef
ifeq ($(enable-werror),yes)
--
2.1.0