diff options
| author | Ilya Leoshkevich <[email protected]> | 2023-02-13 17:45:49 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2023-02-14 14:39:41 +0100 |
| commit | 47297d8bf2f516b66b6d45934849137ab7658a99 (patch) | |
| tree | b56300d1919068a34b6fac93d7d2c4b54e3c4062 /lib | |
| parent | 8ececddf9de612bc556b16df234254291196a65d (diff) | |
printversion: Fix unused variable
clang complains:
debuginfod.cxx:354:1: error: unused variable 'apba__' [-Werror,-Wunused-const-variable]
ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
^
../lib/printversion.h:47:21: note: expanded from macro 'ARGP_PROGRAM_BUG_ADDRESS_DEF'
const char *const apba__ __asm ("argp_program_bug_address")
^
The default linkage for consts in C++ is internal, so declare them
extern. While at it, remove the debuginfod workaround for
argp_program_version_hook.
Co-developed-by: Mark Wielaard <[email protected]>
Signed-off-by: Ilya Leoshkevich <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/printversion.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/printversion.h b/lib/printversion.h index a9e059ff..4154b328 100644 --- a/lib/printversion.h +++ b/lib/printversion.h @@ -39,10 +39,13 @@ void print_version (FILE *stream, struct argp_state *state); argp_program_bug_address, in all programs. argp.h declares these variables as non-const (which is correct in general). But we can do better, it is not going to change. So we want to move them into - the .rodata section. Define macros to do the trick. */ + the .rodata section. Define macros to do the trick. The default + linkage for consts in C++ is internal, so declare them extern. */ +extern void (*const apvh) (FILE *, struct argp_state *); #define ARGP_PROGRAM_VERSION_HOOK_DEF \ void (*const apvh) (FILE *, struct argp_state *) \ __asm ("argp_program_version_hook") +extern const char *const apba__; #define ARGP_PROGRAM_BUG_ADDRESS_DEF \ const char *const apba__ __asm ("argp_program_bug_address") |
