From fbf2e3cf8fc07ef9f8b7cc4627fec82885560f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sat, 12 Dec 2015 02:34:47 +0000 Subject: Make init_progfile_dir() take a function pointer [-Wpedantic] Change-Id: I45f8ea5ee6ccc5a484c60ad6e686aaf30f6b0c98 Reviewed-on: https://code.wireshark.org/review/12557 Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- wsutil/filesystem.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'wsutil/filesystem.c') diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 787ad6ebb4..e8bdea325a 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -62,6 +62,7 @@ #include #include #include +#include #include /* for WTAP_ERR_SHORT_WRITE */ @@ -454,7 +455,7 @@ init_progfile_dir(const char *arg0 #ifdef _WIN32 _U_ #endif -, void *function_addr +, int (*function_addr)(int, char **) #if defined(_WIN32) || !defined(HAVE_DLADDR) _U_ #endif @@ -560,8 +561,11 @@ init_progfile_dir(const char *arg0 * path and obviate the need for us to determine the absolute * path. */ - if (dladdr(function_addr, &info)) +DIAG_OFF(pedantic) + if (dladdr((void *)function_addr, &info)) { +DIAG_ON(pedantic) execname = info.dli_fname; + } } #endif if (execname == NULL) { -- cgit v1.2.1