This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [obv] Make 'disable_display' static.


>   . why is it a good idea to go hunting for functions not used outside
>     its source file and make them static?  I don't see this
>     requirement in any coding standards document pertinent to GDB.

I think it is a good idea, because it helps us (developers) a lot
when we see that a variable or function is static, and thus only
referenced within the unit.

It also helps the compiler, because it is now able to notify us
when a symbol is no longer referenced, and thus a candidate
for deletion. Without making them "static", we don't get the
compiler warning.

More generally, I think that everything should be static/const
by default, and anything that is not needs to explained (when
not obvious, or course).

>   . if this is NOT mandated by any coding standards we try to enforce,
>     why is this an "obvious" patch?

I do not necessarily consider these patches obvious, because
I've seen emails on this list suggesting that we seem to be flexible
with uncontributed code which might be needing the symbol to
be exported rather than static.  But I think that they generally
go in the right direction and should be encouraged.

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]