octave-patch-tracker
[Top][All Lists]
Advanced

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

[Octave-patch-tracker] [patch #8919] Start of patch to enable visibility


From: John W. Eaton
Subject: [Octave-patch-tracker] [patch #8919] Start of patch to enable visibility attributes for GCC in build system
Date: Wed, 16 Dec 2020 17:38:40 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #5, patch #8919 (project octave):

"Isn't the idea to turn everything off (visibility=hidden) and then only
selectively re-enable visibility for the symbols that need it?"

Yes.

File static functions are always hidden.  They don't need a visibility
attribute for that.  But they can only be used in one file.

Functions that we want to be private in, say, liboctave but that need to be
available to more than one file in the sources will also remain hidden in the
shared library and have no public declaration.  These functions can't be
declared static because they need to be accessible in multiple files.  They
would be declared in internal header file(s) that is (are) not installed for
users.  For example, we currently have a few header files that we don't
install, but we don't prevent users from accessing the functions from the
shared library because we don't set the visibility attribute to hidden.

All other functions that appear in public header files should have the
visibility=default attribute applied.

BTW, I think we can do this more simply by tagging the "namespace octave"
declaration with a visibility attribute.  Then we don't have to tag every
individual function.  And if I understand correctly, it should only apply to
the symbols in the tagged namespace declaration.  So some "namespace octave"
declarations can be hidden and others not.

Currently, nearly everything in Octave has a declaration in a public header
file and all symbols are visible in the shared libraries.  If we want to get
serious about the visibility attributes, then we should probably also be
deciding which symbols really should have declarations in public header
files.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?8919>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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