On Thu, 12 Dec 2019 12:57:20 +0300 Aleksei Nikiforov wrote: > Found via cppcheck: > [apt/cmdline/apt-cdrom.cc:66] -> [apt/cmdline/apt-cdrom.cc:149]: > (style) Local variable 'Buf' shadows outer variable > --- > apt/cmdline/apt-cdrom.cc | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/apt/cmdline/apt-cdrom.cc b/apt/cmdline/apt-cdrom.cc > index eded525..93ad41d 100644 > --- a/apt/cmdline/apt-cdrom.cc > +++ b/apt/cmdline/apt-cdrom.cc > @@ -146,7 +146,6 @@ bool FindPackages(string CD,vector &List,vector &SList, > #endif > > // See if the name is a sub directory > - struct stat Buf; > if (stat(Dir->d_name,&Buf) != 0) > continue; > LGTM since Buf declared outside of the for loop is not used after the loop and it is unlikely it will be ever dereferenced after the loop. Best regards, Andrew Savchenko