This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: -Winline option
- From: David Miller <davem at davemloft dot net>
- To: roland at hack dot frob dot com
- Cc: fweimer at redhat dot com, libc-alpha at sourceware dot org
- Date: Thu, 09 Apr 2015 17:12:38 -0400 (EDT)
- Subject: Re: -Winline option
- Authentication-results: sourceware.org; auth=none
- References: <55269642 dot 8040507 at redhat dot com> <20150409 dot 141202 dot 1584701513523037804 dot davem at davemloft dot net> <20150409192408 dot 6BB132C3B96 at topped-with-meat dot com>
From: Roland McGrath <roland@hack.frob.com>
Date: Thu, 9 Apr 2015 12:24:08 -0700 (PDT)
> Heretofore we have said that the inline keyword should be dropped if it's
> not essential that something be inlined. Then the compiler will still
> inline it if it thinks that's optimal, but won't warn.
In this particular case the inline is in a header file to provide a
function used by applications.
If you remove the inline keyword, then every include of scratch_buffer.h
gets a static copy in it's object file, moreso the compiler is going to
warn if the function is unused by that foo.c file.
I still stand by my position that -Winline is foolhardy and thus should
be removed.