bug-gnulib
[Top][All Lists]
Advanced

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

Re: cppcheck error in opendir.c


From: Arno Onken
Subject: Re: cppcheck error in opendir.c
Date: Wed, 20 Mar 2013 17:38:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

On 03/20/2013 04:28 PM, Paul Eggert wrote:
> On 03/20/13 03:38, Arno Onken wrote:
>> The following code in opendir.c silences cppcheck:
>>
>> {{{
>> #if !defined(HAVE_OPENDIR) && defined(REPLACE_FCHDIR)
>> #error Invalid configuration!!
>> #endif
>> }}}
> 
> It may silence cppcheck, but I'm afraid I don't see why it's
> correct or needed.  Can you explain the error scenario
> in more detail?

It is explained in the second post on the bug tracker:

Comment(by amai):

 Well, I am just looking at lib/opendir.c - and I have no idea about the
 correlation of involved macros ''HAVE_OPENDIR'' and ''REPLACE_FCHDIR'' ...
 So ''ifndef HAVE_OPENDIR'' and ''#ifdef REPLACE_FCHDIR'' cppcheck is
 right, ''dirp'' is allocated by ''malloc()'' and passed to ''closedir()''.



reply via email to

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