diff options
author | Ezra Peisach <epeisach@mit.edu> | 2011-07-26 10:46:50 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2011-07-26 10:46:50 +0000 |
commit | 32ffc4505e6334d8bcd287e89b88f35d9d9f2539 (patch) | |
tree | 9deb9da84b2a317b3850771cbec9b57d715021be /src/lib/krb5 | |
parent | 94beb5ada2faa6d0a7416e1edc5c3e8c962189a9 (diff) | |
download | krb5-32ffc4505e6334d8bcd287e89b88f35d9d9f2539.tar.gz krb5-32ffc4505e6334d8bcd287e89b88f35d9d9f2539.tar.xz krb5-32ffc4505e6334d8bcd287e89b88f35d9d9f2539.zip |
For GCC compiles, use an attribute to suppress the variable set but
not used warnings. Due to the nested macros, it would get very ugly
to try and remove the variables.
Removes ~75 warnings from the build.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25054 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5')
-rw-r--r-- | src/lib/krb5/asn.1/asn1_k_decode_macros.h | 32 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/krb5_decode.c | 4 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/krb5_decode_kdc.c | 4 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/krb5_decode_macros.h | 16 |
4 files changed, 34 insertions, 22 deletions
diff --git a/src/lib/krb5/asn.1/asn1_k_decode_macros.h b/src/lib/krb5/asn.1/asn1_k_decode_macros.h index e3e7fc08bb..de433c2da0 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode_macros.h +++ b/src/lib/krb5/asn.1/asn1_k_decode_macros.h @@ -32,15 +32,21 @@ #include "asn1_get.h" #include "asn1_misc.h" +#if __GNUC__ >= 3 +#define KRB5_ATTR_UNUSED __attribute__((unused)) +#else +#define KRB5_ATTR_UNUSED +#endif + #define clean_return(val) { retval = val; goto error_out; } /* Declare useful decoder variables. */ -#define setup() \ - asn1_error_code retval; \ - asn1_class asn1class; \ - asn1_construction construction; \ - asn1_tagnum tagnum; \ - unsigned int length, taglen +#define setup() \ + asn1_error_code retval; \ + asn1_class asn1class; \ + asn1_construction construction KRB5_ATTR_UNUSED; \ + asn1_tagnum tagnum; \ + unsigned int length, taglen KRB5_ATTR_UNUSED #define unused_var(x) if (0) { x = 0; x = x - x; } @@ -262,7 +268,7 @@ asn1_get_eoc_tag (asn1buf *buf) #define begin_choice() \ asn1buf subbuf; \ int seqindef; \ - int indef; \ + int indef KRB5_ATTR_UNUSED; \ taginfo t; \ retval = asn1_get_tag_2(buf, &t); \ if (retval) clean_return(retval); \ @@ -290,12 +296,12 @@ asn1_get_eoc_tag (asn1buf *buf) * meant to be called in an inner block that ends with a call to * end_sequence_of(). */ -#define sequence_of(buf) \ - unsigned int length, taglen; \ - asn1_class asn1class; \ - asn1_construction construction; \ - asn1_tagnum tagnum; \ - int indef; \ +#define sequence_of(buf) \ + unsigned int length, taglen KRB5_ATTR_UNUSED ; \ + asn1_class asn1class; \ + asn1_construction construction KRB5_ATTR_UNUSED ; \ + asn1_tagnum tagnum; \ + int indef; \ sequence_of_common(buf) /* diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index 6cee3d681d..10ebcac1cd 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -864,8 +864,8 @@ decode_krb5_pa_fx_fast_reply(const krb5_data *code, krb5_enc_data **repptr) setup(krb5_enc_data *); alloc_field(rep); { - int indef; - unsigned int taglen; + int indef KRB5_ATTR_UNUSED; + unsigned int taglen KRB5_ATTR_UNUSED; next_tag_from_buf(buf); if (tagnum != 0) clean_return(ASN1_BAD_ID); diff --git a/src/lib/krb5/asn.1/krb5_decode_kdc.c b/src/lib/krb5/asn.1/krb5_decode_kdc.c index 21a3ec232f..36380c2fbd 100644 --- a/src/lib/krb5/asn.1/krb5_decode_kdc.c +++ b/src/lib/krb5/asn.1/krb5_decode_kdc.c @@ -126,8 +126,8 @@ decode_krb5_pa_fx_fast_request(const krb5_data *code, krb5_fast_armored_req **re alloc_field(rep); clear_field(rep, armor); { - int indef; - unsigned int taglen; + int indef KRB5_ATTR_UNUSED; + unsigned int taglen KRB5_ATTR_UNUSED; next_tag_from_buf(buf); if (tagnum != 0) clean_return(ASN1_BAD_ID); diff --git a/src/lib/krb5/asn.1/krb5_decode_macros.h b/src/lib/krb5/asn.1/krb5_decode_macros.h index fc86705001..16ae6fe2fe 100644 --- a/src/lib/krb5/asn.1/krb5_decode_macros.h +++ b/src/lib/krb5/asn.1/krb5_decode_macros.h @@ -32,6 +32,12 @@ #include "asn1_get.h" #include "asn1_misc.h" +#if __GNUC__ >= 3 +#define KRB5_ATTR_UNUSED __attribute__((unused)) +#else +#define KRB5_ATTR_UNUSED +#endif + /* setup *********************************************************/ /* set up variables */ /* @@ -47,13 +53,13 @@ retval = asn1buf_wrap_data(&buf,code); \ if (retval) return retval -#define setup_no_tagnum(type) \ - asn1_class asn1class; \ - asn1_construction construction; \ +#define setup_no_tagnum(type) \ + asn1_class asn1class KRB5_ATTR_UNUSED; \ + asn1_construction construction KRB5_ATTR_UNUSED; \ setup_buf_only(type) #define setup_no_length(type) \ - asn1_tagnum tagnum; \ + asn1_tagnum tagnum KRB5_ATTR_UNUSED; \ setup_no_tagnum(type) #define setup(type) \ @@ -132,7 +138,7 @@ asn1_get_eoc_tag (asn1buf *buf) /* decode sequence header and initialize tagnum with the first field */ #define begin_structure() \ - unsigned int taglen; \ + unsigned int taglen KRB5_ATTR_UNUSED; \ asn1buf subbuf; \ int seqindef; \ int indef; \ |