bug-gnulib
[Top][All Lists]
Advanced

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

Re: popen on OSF/1 5.1


From: Jim Meyering
Subject: Re: popen on OSF/1 5.1
Date: Tue, 21 Dec 2010 11:00:20 +0100

Bruno Haible wrote:
> On OSF/1 5.1 I got these test build failures:
>
> depbase=`echo test-stdio-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; g++ 
> -DHAVE_CONFIG_H -I.   -DGNULIB_STRICT_CHECKING=1  -I. -I.  -I.. -I./..  
> -I../gllib -I./../gllib -mieee   -MT test-stdio-c++.o -MD -MP -MF 
> $depbase.Tpo -c -o test-stdio-c++.o test-stdio-c++.cc && mv -f $depbase.Tpo 
> $depbase.Po
> In file included from /usr/include/mesg.h:52,
>                  from /usr/include/nl_types.h:75,
>                  from /usr/include/sys/lc_core.h:58,
>                  from /usr/include/sys/localedef.h:76,
>                  from /usr/include/ctype.h:108,
>                  from ../gllib/ctype.h:36,
>                  from ../gllib/getopt.h:112,
>                  from 
> /opt/fsw/gcc42/lib/gcc/alpha-dec-osf5.1/4.2/include/stdio.h:493,
>                  from ../gllib/stdio.h:36,
>                  from test-stdio-c++.cc:22:
> ../gllib/stdio.h:954: error: '::popen' has not been declared
> ../gllib/stdio.h:956: error: 'popen' was not declared in this scope
> ../gllib/stdio.h:956: error: invalid type in declaration before ';' token
> In file included from ../gllib/stdio.h:36,
>                  from test-stdio-c++.cc:22:
> /opt/fsw/gcc42/lib/gcc/alpha-dec-osf5.1/4.2/include/stdio.h:502: error: 
> 'FILE* popen(const char*, const char*)' redeclared as different kind of symbol
> ../gllib/stdio.h:956: error: previous declaration of 'int popen'
> *** Exit 1
>
> The reason is that while the system header does declare popen(), this
> declaration comes too late, because a recursive include of gnulib's
> <stdio.h> leads to a use of popen as a function pointer before the
> entire system's <stdio.h> has been processed.
>
> gllib/stdio.h:36
> -> /opt/fsw/gcc42/lib/gcc/alpha-dec-osf5.1/4.2/include/stdio.h:493
>    -> gllib/getopt.h:112
>       -> gllib/ctype.h:36
>          -> /usr/include/ctype.h:108
>             -> /usr/include/sys/localedef.h:76
>                -> /usr/include/sys/lc_core.h:58
>                   -> /usr/include/nl_types.h:75
>                      -> /usr/include/mesg.h:52
>                         -> gllib/stdio.h
>
> (In order to analyze this, I needed "gcc -E -dD". Thanks for the tip, Jim!)
>
> This fixes it. This patch may be dangerous for other platforms, so Jim,
> you might want to exclude it from your next coreutils build.
>
>
> 2010-12-19  Bruno Haible  <address@hidden>
>
>       stdio: Fix problem with popen() declaration on OSF/1 5.1.
>       * lib/stdio.in.h: During the include_next statement, let recursive
>       includes of this file include only the system header file.

Hi Bruno,

Thanks for the warning.
I did as you suggested, and was planning to use
gnulib updated to just before this commit.
However, now that Paul has fixed the Solaris 8/9 snprintf bug, ...
Weighing the possible risk of your change against
the benefit of his fix (albeit for platforms that
are going out of style quickly), I am inclined to risk it.



reply via email to

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