Get rid of warning inlining failed in call to maybe_swap_uint32
diff mbox

Message ID 5489BB43.5070003@linux.vnet.ibm.com
State New
Headers show

Commit Message

Stefan Liebler Dec. 11, 2014, 3:41 p.m. UTC
Hi,

this patch disables warning/error:
In file included from programs/locarchive.c:49:0:
programs/locarchive.c: In function ‘add_locale’:
programs/locfile.h:85:1: warning: inlining failed in call to 
‘maybe_swap_uint32’: call is unlikely and code size would grow [-Winline]
programs/locarchive.c:981:12: warning: called from here [-Winline]

The function maybe_swap_uint32 isn´t marked as inline anymore, which 
avoids the inlining warning.
The unused attribute was added due to the inclusion of locfile.h in 
linereader.c, which does not use maybe_swap_uint32 function.

Tested on s390.

Ok to commit?

Bye
Stefan

---
2014-12-11  Stefan Liebler  <stli@linux.vnet.ibm.com>

	locale/programs/locfile.h (maybe_swap_uint32):
	Remove inline and add unused attribute.

Comments

Joseph Myers Dec. 11, 2014, 3:45 p.m. UTC | #1
On Thu, 11 Dec 2014, Stefan Liebler wrote:

> 2014-12-11  Stefan Liebler  <stli@linux.vnet.ibm.com>
> 
> 	locale/programs/locfile.h (maybe_swap_uint32):
> 	Remove inline and add unused attribute.

OK.

Patch
diff mbox

diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
index b579a46..dd00c0d 100644
--- a/locale/programs/locfile.h
+++ b/locale/programs/locfile.h
@@ -81,7 +81,8 @@  set_big_endian (bool big_endian)
 
 /* Munge VALUE so that, when stored, it has the correct byte order
    for the output files.  */
-static inline uint32_t
+static uint32_t
+__attribute__ ((unused))
 maybe_swap_uint32 (uint32_t value)
 {
   return swap_endianness_p ? bswap_32 (value) : value;