The documentation for the visibility attribute shown by the "info gcc 'c
extension' function" command is misleading. It says:

"`visibility ("VISIBILITY_TYPE")'
     The `visibility' attribute on ELF targets causes the declaration
     to be emitted with default, hidden, protected or internal
     visibility.

          void __attribute__ ((visibility ("protected")))
          f () { /* Do something. */; }
          int i __attribute__ ((visibility ("hidden")));"

Note that the attribute is attached to the return type of the function "f", not
the function declaration itself. I think this means that the hidden visibility
is applied to the type, not the function, which is strange.

I'm looking at the documentation from gcc trunk.


-- 
           Summary: Documentation: Example usage of
                    __attribute__((visibility("hidden"))) misleading
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rich at phekda dot gotadsl dot co dot uk
 GCC build triplet: Not applicable
  GCC host triplet: Not applicable
GCC target triplet: Not applicable


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30361

Reply via email to