On 27 April 2013 15:38, Tobias Ulmer <tobi...@tmux.org> wrote: > On Sat, Apr 27, 2013 at 09:14:59PM +0200, Otto Moerbeek wrote: >> On Sat, Apr 27, 2013 at 09:09:25PM +0200, Franco Fichtner wrote: >> >> > On Apr 27, 2013, at 7:36 PM, Ted Unangst <t...@tedunangst.com> wrote: >> > >> > > On Sat, Apr 27, 2013 at 08:10, Otto Moerbeek wrote: >> > >> On Sat, Apr 27, 2013 at 01:08:06AM -0400, Eitan Adler wrote: >> > >> >> > >>> Adding static to internal function allows the compiler to better >> > >>> detect dead code (functions, variables, etc) and makes it easier for >> > >>> the compiler to optimize; e.g., since it knows a function will only >> > >>> called once it can inline code; or not output a symbol for a certain >> > >>> function. >> > >> >> > >> In general we don't lik this because it makes things harder to debug. >> > >> For libraries, yes, but for programs, no. >> > > >> > > Isn't that rule only for the kernel? ddb can only see global symbols, >> > > but gdb should work fine in userland. Certainly I can set breakpoints >> > > on static functions, even when compiled without -g. >> > >> > On backtrace(3) (which is a GNU thing, I know), static functions don't >> > show up with their respective names even though they are in the binary. >> > That's a tad annoying, but I am not aware of any other limitation. Can >> > someone please enlighten me? >> >> Inlined functions are pretyy confusing in gdb. > > So basically we're making the code more difficult to understand because > we don't want to spend the one-time effort to move the static > "inlinification" from -O2 to -O3...
-finline-functions is enabled at -O3 only. -finline-functions-called-once is enabled at even -O1 -- Eitan Adler