From e1d15f5e3b03bccb229281e762f9d47cf0933542 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 18 Nov 2012 17:03:38 +0000 Subject: [PATCH 1/1] More compiler quietening. --- src/src/auths/call_pam.c | 7 +++++-- src/src/auths/call_radius.c | 6 ++++-- src/src/auths/cyrus_sasl.c | 4 +++- src/src/auths/gsasl_exim.c | 3 ++- src/src/auths/heimdal_gssapi.c | 4 +++- src/src/lookups/spf.c | 4 +++- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/src/auths/call_pam.c b/src/src/auths/call_pam.c index bec5c5744..710de7ded 100644 --- a/src/src/auths/call_pam.c +++ b/src/src/auths/call_pam.c @@ -16,10 +16,13 @@ available for compiling. Therefore, compile these functions only if SUPPORT_PAM is defined. However, some compilers don't like compiling empty modules, so keep them happy with a dummy when skipping the rest. Make it reference itself to stop picky compilers complaining that it is unused, and put in a dummy argument -to stop even pickier compilers complaining about infinite loops. */ +to stop even pickier compilers complaining about infinite loops. +Then use a mutually-recursive pair as gcc is just getting stupid. */ #ifndef SUPPORT_PAM -static void dummy(int x) { dummy(x-1); } +static void dummy(int x); +static void dummy2(int x) { dummy(x-1); } +static void dummy(int x) { dummy2(x-1); } #else /* SUPPORT_PAM */ #ifdef PAM_H_IN_PAM diff --git a/src/src/auths/call_radius.c b/src/src/auths/call_radius.c index 4bbe6d754..2064ed221 100644 --- a/src/src/auths/call_radius.c +++ b/src/src/auths/call_radius.c @@ -20,10 +20,12 @@ RADIUS_CONFIG_FILE is defined. However, some compilers don't like compiling empty modules, so keep them happy with a dummy when skipping the rest. Make it reference itself to stop picky compilers complaining that it is unused, and put in a dummy argument to stop even pickier compilers complaining about infinite -loops. */ +loops. Then use a mutually-recursive pair as gcc is just getting stupid. */ #ifndef RADIUS_CONFIG_FILE -static void dummy(int x) { dummy(x-1); } +static void dummy(int x); +static void dummy2(int x) { dummy(x-1); } +static void dummy(int x) { dummy2(x-1); } #else /* RADIUS_CONFIG_FILE */ diff --git a/src/src/auths/cyrus_sasl.c b/src/src/auths/cyrus_sasl.c index ca589287e..c7fb59348 100644 --- a/src/src/auths/cyrus_sasl.c +++ b/src/src/auths/cyrus_sasl.c @@ -25,7 +25,9 @@ in a dummy argument to stop even pickier compilers complaining about infinite loops. */ #ifndef AUTH_CYRUS_SASL -static void dummy(int x) { dummy(x-1); } +static void dummy(int x); +static void dummy2(int x) { dummy(x-1); } +static void dummy(int x) { dummy2(x-1); } #else diff --git a/src/src/auths/gsasl_exim.c b/src/src/auths/gsasl_exim.c index 8f7541642..87be9b5e1 100644 --- a/src/src/auths/gsasl_exim.c +++ b/src/src/auths/gsasl_exim.c @@ -29,7 +29,8 @@ sense in all contexts. For some, we can do checks at init time. #ifndef AUTH_GSASL /* dummy function to satisfy compilers when we link in an "empty" file. */ -static void dummy2(int x) { dummy2(x-1); } +static void dummy(int x); +static void dummy2(int x) { dummy(x-1); } static void dummy(int x) { dummy2(x-1); } #else diff --git a/src/src/auths/heimdal_gssapi.c b/src/src/auths/heimdal_gssapi.c index c6e973ad9..21ed75bf4 100644 --- a/src/src/auths/heimdal_gssapi.c +++ b/src/src/auths/heimdal_gssapi.c @@ -43,7 +43,9 @@ Without rename, we could add an option for GS2 support in the future. #ifndef AUTH_HEIMDAL_GSSAPI /* dummy function to satisfy compilers when we link in an "empty" file. */ -static void dummy(int x) { dummy(x-1); } +static void dummy(int x); +static void dummy2(int x) { dummy(x-1); } +static void dummy(int x) { dummy2(x-1); } #else #include diff --git a/src/src/lookups/spf.c b/src/src/lookups/spf.c index 862243850..23ad2addd 100644 --- a/src/src/lookups/spf.c +++ b/src/src/lookups/spf.c @@ -18,7 +18,9 @@ #include "../exim.h" #ifndef EXPERIMENTAL_SPF -static void dummy(int x) { dummy(x-1); } +static void dummy(int x); +static void dummy2(int x) { dummy(x-1); } +static void dummy(int x) { dummy2(x-1); } #else #include "lf_functions.h" -- 2.30.2