nats.c icon indicating copy to clipboard operation
nats.c copied to clipboard

No visibility attributes on functions

Open rigtorp opened this issue 6 years ago • 0 comments

Internal functions should have __attribute__((visibility("hidden"))) and public API functions should have attribute __attribute__((visibility("default"))) (or MSVC equivalent). CMake can generate appropriate macros https://cmake.org/cmake/help/v3.0/module/GenerateExportHeader.html.

The reason to do this is to avoid polluting the dynamic symbol table with internal functions and allow LTO to optimize better.

rigtorp avatar May 22 '19 19:05 rigtorp