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

Re: possible open() problem again



On Thursday, 23 August 2007 at 22:36, Ian Chapman wrote:
> Hi all,
> 
> I'm wondering if any C guru can help with this. I've already fixed a few 
> of my packages to use correct parameters when calling open() but this 
> one is beyond my limited knowledge. I'm assuming this particular problem 
> is related anyway. When compiling against devel I get:
> 
> <snip>
> ...
> ...
>         then mv -f ".deps/chains.Tpo" ".deps/chains.Plo"; else rm -f 
> ".deps/chains.Tpo"; exit 1; fi
>  gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -D_REENTRANT -D_GNU_SOURCE -O2 
> -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
> --param=ssp-buf
> fer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables 
> -MT chains.lo -MD -MP -MF .deps/chains.Tpo -c chains.c  -fPIC -DPIC -o 
> .libs/chains
> .o
> chains.c:171: error: expected identifier or '(' before '__extension__'
> make[4]: *** [chains.lo] Error 1
> make[4]: *** Waiting for unfinished jobs....
> make[4]: Leaving directory `/builddir/build/BUILD/zvbi-0.2.25/src'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/builddir/build/BUILD/zvbi-0.2.25/src'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/builddir/build/BUILD/zvbi-0.2.25/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/builddir/build/BUILD/zvbi-0.2.25'
> make: *** [all] Error 2
> </snip>
> 
> 
> The line it refers to is:
> 
> 
> <snip>
> int open(const char *pathname, int flags, ...)
> {
>    va_list args;
>    mode_t mode = 0;
> 
>    CHECK_INIT();
> 
>    va_start(args, flags);
>    if (flags & O_CREAT)
>    {
>       if (sizeof(int) >= sizeof(mode_t))
>       {
>          mode = va_arg(args, int);
>       }
>       else
>       {
>          mode = va_arg(args, mode_t);
>       }
>    }
>    va_end(args);#
> ...
> ...
> </snip>

If this function is not used outside that source file, try making it
static. Otherwise rename it to something else.

Regards,
R.

-- 
Fedora contributor http://fedoraproject.org/wiki/DominikMierzejewski
Livna contributor http://rpm.livna.org MPlayer developer http://mplayerhq.hu
"Faith manages."
        -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"


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