bug-datamash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] decrease visibility of local symbols


From: Dima Kogan
Subject: Re: [PATCH 2/3] decrease visibility of local symbols
Date: Sun, 26 Jan 2025 18:51:52 -0800

Keeping your symbols localized is general good hygiene, and has even
more upsides:

- The robot reader of the code (the compiler) gains a higher level of
  understanding: it gets knowledge of the FULL list of callers of such a
  function, and is free to make deep optimizations, like inlining the
  function

- The human reader of the code also gains a higher level of
  understanding. With local functions I also know about exactly what
  paths are possible for calling them by simply doing a text search in
  one file.

Relatedly, the linker visibility settings are controllable also (gcc
-fvisibility or attribute((visibility))), but that's important for
shared libraries, and less so for executables.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]