Use __EXPORTED rather than EXPORT_SYMBOL
PATCH 1/1 Use __EXPORTED rather than EXPORT_SYMBOL
clang is sensitive to the ordering of __attribute__((visibility("default"))) relative to the function body. gcc is not. So if we try to re-declare an existing function with default visibility, clang prints a warning and generates a broken .so file in which nfct_timeout_* are not exported to library callers.
Move the attribute up into the function definition to make clang happy.
--- doxygen.cfg.in | 2 +- src/internal.h | 5 ++--- src/libnetfilter_cttimeout.c | 44 +++++++++++++++++--------------------------- 3 files changed, 20 insertions(+), 31 deletions(-)
doxygen.cfg.in +1 -1
@@ -72,7 +72,7 @@ RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = */.git/* .*.d -EXCLUDE_SYMBOLS = EXPORT_SYMBOL nfct_timeout _container_policy_cb +EXCLUDE_SYMBOLS = nfct_timeout _container_policy_cb EXAMPLE_PATH = EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO
src/internal.h +2 -3
@@ -3,10 +3,9 @@#include "config.h" #ifdef HAVE_VISIBILITY_HIDDEN -# define __visible __attribute__((visibility("default"))) -# define EXPORT_SYMBOL (x) typeof(x) (x) __visible +# define __EXPORTED __attribute__((visibility("default")))#else -# define EXPORT_SYMBOL +# define __EXPORTED#endif #endif
src/libnetfilter_cttimeout.c +17 -27
188 lines not on this page · raw message
Signature · 1 line
2.11.0.390.gc69c2f50cf-goog
PATCH 1/1 Use __EXPORTED rather than EXPORT_SYMBOL
clang is sensitive to the ordering of __attribute__((visibility("default"))) relative to the function body. gcc is not. So if we try to re-declare an existing function with default visibility, clang prints a warning and generates a broken .so file in which nfct_helper_* are not exported to library callers.
Move the attribute up into the function definition to make clang happy.
--- doxygen.cfg.in | 2 +- src/internal.h | 5 ++- src/libnetfilter_cthelper.c | 83 ++++++++++++++++++--------------------------- 3 files changed, 36 insertions(+), 54 deletions(-)
doxygen.cfg.in +1 -1
@@ -72,7 +72,7 @@ RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = */.git/* .*.d -EXCLUDE_SYMBOLS = EXPORT_SYMBOL +EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO
src/internal.h +2 -3
@@ -3,10 +3,9 @@#include "config.h" #ifdef HAVE_VISIBILITY_HIDDEN -# define __visible __attribute__((visibility("default"))) -# define EXPORT_SYMBOL (x) typeof(x) (x) __visible +# define __EXPORTED __attribute__((visibility("default")))#else -# define EXPORT_SYMBOL +# define __EXPORTED#endif #endif
src/libnetfilter_cthelper.c +33 -50
302 lines not on this page · raw message
Signature · 1 line
2.11.0.390.gc69c2f50cf-goog
Pablo Neira Ayuso
maintainerQuoted 8 lines · Kevin Cernekee
clang is sensitive to the ordering of __attribute__((visibility("default"))) relative to the function body. gcc is not. So if we try to re-declare an existing function with default visibility, clang prints a warning and generates a broken .so file in which nfct_helper_* are not exported to library callers.
Move the attribute up into the function definition to make clang happy.
Also applied, thanks.
Quoted 8 lines · Kevin Cernekee
clang is sensitive to the ordering of __attribute__((visibility("default"))) relative to the function body. gcc is not. So if we try to re-declare an existing function with default visibility, clang prints a warning and generates a broken .so file in which nfct_timeout_* are not exported to library callers.
Move the attribute up into the function definition to make clang happy.
Applied, thanks.