bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: utimens: new shadowing warning


From: Eric Blake
Subject: Re: utimens: new shadowing warning
Date: Thu, 31 Dec 2009 18:24:30 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

>   utimens.c: In function 'lutimens':
>   utimens.c:425: error: declaration of 'st' shadows a previous local [-
Wshadow]
>   utimens.c:404: error: shadowed declaration is here [-Wshadow]
> 
> This patch is nearly minimal, but perhaps not ideal.

Thanks for the report.  And your assessment of being non-ideal is correct.

> You might prefer to retain the name "st",
> and simply declare each in its own scope,
> but that'd be more invasive.

I just spotted a larger logic problem - on Linux kernels between 2.6.19 and 
2.6.22 (when utimensat existed, but rejected AT_SYMLINK_NOFOLLOW)(, we are now 
calling lstat twice when only once is necessary.  Therefore, I think the best 
course of action is to reuse a single stat buffer, and guarantees at most one 
lstat per lutimens.  I'll work up the patch.

-- 
Eric Blake







reply via email to

[Prev in Thread] Current Thread [Next in Thread]