configure fails to find arpa/nameser.h when CFLAGS="-ansi" is used

Bug #696952 reported by Austin English
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: libc6-dev

Originally reported here:
http://bugs.winehq.org/show_bug.cgi?id=4510

though the header itself should be fixed, not wine.

ii libc6-dev 2.12.1-0ubuntu10 Embedded GNU C Library: Development Libraries and Header Files
ii libc6-dev-i386 2.12.1-0ubuntu10 GNU C Library: 32-bit development libraries for AMD64

Currently using ubuntu 10.10, but this has always been an issue.

Revision history for this message
Matthias Klose (doko) wrote :

example?

Revision history for this message
Austin English (austinenglish) wrote :

checking arpa/nameser.h usability... no
checking arpa/nameser.h presence... yes
configure: WARNING: arpa/nameser.h: present but cannot be compiled
configure: WARNING: arpa/nameser.h: check for missing prerequisite headers?
configure: WARNING: arpa/nameser.h: see the Autoconf documentation
configure: WARNING: arpa/nameser.h: section "Present But Cannot Be Compiled"
configure: WARNING: arpa/nameser.h: proceeding with the compiler's result
configure: WARNING: ## ------------------------------------ ##
configure: WARNING: ## Report this to <email address hidden> ##
configure: WARNING: ## ------------------------------------ ##
checking for arpa/nameser.h... no

I'll attach config.log.

From the Wine bug report:
"With CFLAGS="-ansi", the configure check for arpa/nameser.h fails to compile.

This is caused by nameser.h relying on BSD libc features to compile, which
aren't enabled when -ansi is defined."

Revision history for this message
Matthias Klose (doko) wrote : Re: [Bug 696952] Re: configure fails to find arpa/nameser.h when CFLAGS="-ansi" is used

On 04.01.2011 01:38, Austin English wrote:
> checking arpa/nameser.h usability... no
> checking arpa/nameser.h presence... yes
> configure: WARNING: arpa/nameser.h: present but cannot be compiled
> configure: WARNING: arpa/nameser.h: check for missing prerequisite headers?
> configure: WARNING: arpa/nameser.h: see the Autoconf documentation
> configure: WARNING: arpa/nameser.h: section "Present But Cannot Be Compiled"
> configure: WARNING: arpa/nameser.h: proceeding with the compiler's result
> configure: WARNING: ## ------------------------------------ ##
> configure: WARNING: ## Report this to <email address hidden> ##
> configure: WARNING: ## ------------------------------------ ##
> checking for arpa/nameser.h... no
>
> I'll attach config.log.
>
>> From the Wine bug report:
> "With CFLAGS="-ansi", the configure check for arpa/nameser.h fails to compile.
>
> This is caused by nameser.h relying on BSD libc features to compile, which
> aren't enabled when -ansi is defined."

I was hoping for the source and command line arguments.

Revision history for this message
Austin English (austinenglish) wrote :

http://source.winehq.org/git/wine.git/?a=blob_plain;f=configure;hb=HEAD
http://source.winehq.org/git/wine.git/?a=blob_plain;f=configure.ac;hb=HEAD

the particular snippet is (configure.ac):
AC_CHECK_HEADERS(\
...
 arpa/nameser.h \
...
)

(configure):
for ac_header in \
...
 arpa/nameser.h \
...

do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

if you've got a copy of the wine source, command line used was simply:
CFLAGS="-ansi" ./configure

fwiw, capi20.h and lcms.h have similar problems (present, but can't be used), and detecting libxrandr, libxinerama and libgnutls fails as well. All others work. Bugs haven't been filed for those issues yet.

Revision history for this message
Frédéric Delanoy (frederic-delanoy) wrote :

gcc 4.4.4 and clang 2.8 (versions shipped in Maverick) are both affected.
For the latter, in addition, u_int, u_long are marked as unknown (see attachment)

Revision history for this message
Frédéric Delanoy (frederic-delanoy) wrote :
Download full text (3.3 KiB)

Example with gcc:

#include <arpa/nameser.h>

int main(void)
{
    return 0;
}

Compiling with "gcc -ansi test.c" yields

In file included from test.c:1:
/usr/include/arpa/nameser_compat.h:66: error: duplicate member ‘rd’
/usr/include/arpa/nameser_compat.h:67: error: duplicate member ‘tc’
/usr/include/arpa/nameser_compat.h:68: error: duplicate member ‘aa’
/usr/include/arpa/nameser_compat.h:69: error: duplicate member ‘opcode’
/usr/include/arpa/nameser_compat.h:70: error: duplicate member ‘qr’
/usr/include/arpa/nameser_compat.h:72: error: duplicate member ‘rcode’
/usr/include/arpa/nameser_compat.h:73: error: duplicate member ‘cd’
/usr/include/arpa/nameser_compat.h:74: error: duplicate member ‘ad’
/usr/include/arpa/nameser_compat.h:75: error: duplicate member ‘unused’
/usr/include/arpa/nameser_compat.h:76: error: duplicate member ‘ra’
In file included from test.c:2:
/usr/include/arpa/nameser.h:115: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token
/usr/include/arpa/nameser.h:144: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token
/usr/include/arpa/nameser.h:473: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ns_get16’
/usr/include/arpa/nameser.h:474: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ns_get32’
/usr/include/arpa/nameser.h:475: error: expected ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:476: error: expected ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:477: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:478: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:484: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:488: error: expected ‘)’ before ‘char’
/usr/include/arpa/nameser.h:489: error: expected declaration specifiers or ‘...’ before ‘u_long’
/usr/include/arpa/nameser.h:491: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:492: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:493: error: expected declaration specifiers or ‘...’ before ‘u_char’
/usr/include/arpa/nameser.h:494: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:496: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:498: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:500: error: expected declaration specifiers or ‘...’ before ‘u_char’
/usr/include/arpa/nameser.h:501: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:502: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:503: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:505: error: expected ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:507: error: expected ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:510: error: expected ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:512: error: expected ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:515: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/arpa/nameser.h:517: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/arpa/nameser.h:518: ...

Read more...

Revision history for this message
Dan Kegel (dank) wrote :

I doubt it's a bug in glibc.

When you configure wine with CFLAGS="-ansi", you could go further and do CFLAGS="-ansi -D_BSD_SOURCE".
Or wine could add -D_BSD_SOURCE to its configure script.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.