1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 16:18:48 -05:00

silence picky compilers: mark unused parameters

Modern gcc versions (4.6.X) get more picky by default and have started
to warn for unused parameters, but luckily gcc also allows us to mark
them as unused so that we can avoid the warnings.
This commit is contained in:
Daniel Stenberg 2011-07-12 23:24:52 +02:00
parent 2af0287856
commit ee4ed46128
2 changed files with 15 additions and 6 deletions

View File

@ -83,16 +83,16 @@ krb5_check_prot(void *app_data, int level)
} }
static int static int
krb5_decode(void *app_data, void *buf, int len, int level, krb5_decode(void *app_data, void *buf, int len,
struct connectdata *conn) int level UNUSED_PARAM,
struct connectdata *conn UNUSED_PARAM)
{ {
gss_ctx_id_t *context = app_data; gss_ctx_id_t *context = app_data;
OM_uint32 maj, min; OM_uint32 maj, min;
gss_buffer_desc enc, dec; gss_buffer_desc enc, dec;
/* shut gcc up */ (void)level;
level = 0; (void)conn;
conn = NULL;
enc.value = buf; enc.value = buf;
enc.length = len; enc.length = len;
@ -122,7 +122,7 @@ krb5_overhead(void *app_data, int level, int len)
static int static int
krb5_encode(void *app_data, const void *from, int length, int level, void **to, krb5_encode(void *app_data, const void *from, int length, int level, void **to,
struct connectdata *conn) struct connectdata *conn UNUSED_PARAM)
{ {
gss_ctx_id_t *context = app_data; gss_ctx_id_t *context = app_data;
gss_buffer_desc dec, enc; gss_buffer_desc dec, enc;

View File

@ -580,6 +580,15 @@ int netware_init(void);
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif #endif
/* Provide a mechanism to silence picky compilers, such as gcc 4.6+.
Parameters should of course normally not be unused, but for example when we
have multiple implementations of the same interface it may happen. */
#ifndef __GNUC__
#define UNUSED_PARAM /*NOTHING*/
#else
#define UNUSED_PARAM __attribute__((unused))
#endif
/* /*
* Include macros and defines that should only be processed once. * Include macros and defines that should only be processed once.
*/ */