[SSSD] [PATCH] KRB5: Fix warning declaration shadows global declaration
Lukas Slebodnik
lslebodn at redhat.com
Tue Sep 3 11:47:59 UTC 2013
On (03/09/13 13:34), Jakub Hrozek wrote:
>On Tue, Sep 03, 2013 at 01:09:55PM +0200, Sumit Bose wrote:
>> On Mon, Sep 02, 2013 at 06:25:50PM +0200, Lukas Slebodnik wrote:
>> > On (02/09/13 17:50), Sumit Bose wrote:
>> > >On Mon, Sep 02, 2013 at 05:43:06PM +0200, Lukas Slebodnik wrote:
>> > >> ehlo,
>> > >>
>> > >> I tested some patches on RHEL6. and there is newly introduced warning.
>> > >> gcc version 4.4.7
>> > >>
>> > >> src/providers/krb5/krb5_utils.c:193: warning: declaration of 'rewind' shadows a
>> > >> global declaration
>> > >> /usr/include/stdio.h:754: warning: shadowed declaration is here
>> > >>
>> > >> Warning was introduced in patch dcc6877aa2e2dd63a9dc9c411a9c58feaeb36b9a
>> > >> "krb5: Fetch ccname template from krb5.conf"
>> > >>
>> > >> LS
>> > >
>> > >ACK. I was about to send the same patch, just with a different name :-)
>> > >
>> > >bye,
>> > >Sumit
>> > I renamed "rewind" -> "want_rewind"
>> > What was your proposal? Maybe your will be better.
>>
>> I used 'rerun' the name of the little brother of Linus (van Pelt not
>> Torvalds :-)
>>
>> bye,
>> Sumit
>
>I like the shorter name better.
This was a reason why I asked.
Attached patch contains "shorter version"
LS
-------------- next part --------------
>From c3a4924a7a97306e0ec4169e50ead753394cc681 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Fri, 30 Aug 2013 23:52:15 +0200
Subject: [PATCH] KRB5: Fix warning declaration shadows global declaration
src/providers/krb5/krb5_utils.c:193: warning: declaration of 'rewind' shadows a
global declaration
/usr/include/stdio.h:754: warning: shadowed declaration is here
---
src/providers/krb5/krb5_utils.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index dc4c448efe06a75105f6e9181837cc3c28bd7256..df7892153d2c16fd3e485ed5013454233d228936 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -190,7 +190,7 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
const char *cache_dir_tmpl;
TALLOC_CTX *tmp_ctx = NULL;
char action;
- bool rewind;
+ bool rerun;
*private_path = false;
@@ -223,10 +223,10 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
goto done;
}
- rewind = true;
+ rerun = true;
action = *n;
- while (rewind) {
- rewind = false;
+ while (rerun) {
+ rerun = false;
switch (action) {
case 'u':
if (kr->pd->user == NULL) {
@@ -332,19 +332,19 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
} else if (strncmp(n , S_EXP_UID, L_EXP_UID) == 0) {
action = 'U';
n += L_EXP_UID - 1;
- rewind = true;
+ rerun = true;
continue;
} else if (strncmp(n , S_EXP_USERID, L_EXP_USERID) == 0) {
action = 'U';
n += L_EXP_USERID - 1;
- rewind = true;
+ rerun = true;
continue;
} else if (strncmp(n , S_EXP_EUID, L_EXP_EUID) == 0) {
/* SSSD does not distinguish betwen uid and euid,
* so we treat both the same way */
action = 'U';
n += L_EXP_EUID - 1;
- rewind = true;
+ rerun = true;
continue;
} else if (strncmp(n , S_EXP_NULL, L_EXP_NULL) == 0) {
/* skip immediately */
@@ -352,7 +352,7 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
} else if (strncmp(n , S_EXP_USERNAME, L_EXP_USERNAME) == 0) {
action = 'u';
n += L_EXP_USERNAME - 1;
- rewind = true;
+ rerun = true;
continue;
} else if (strncmp(n , S_EXP_LIBDIR, L_EXP_LIBDIR) == 0) {
/* skip, only the libkrb5 library can resolve this */
--
1.8.3.1
More information about the sssd-devel
mailing list