Page MenuHome GnuPG

Build failed - gpgkeys_curl.c:304: error: 'typeof' applied to a bit-field
Closed, ResolvedPublic

Description

When building with --with-libcurl=... I get errors:

gcc -DHAVE_CONFIG_H -I. -I.. -I../../gnupg-1.4.9/keyserver -I../../gnupg-1.4.9/
include -I../../gnupg-1.4.9/intl -I/usr/local/include -I/usr/local/include -I/
usr/local/include -I/usr/local/include -I/usr/local/include -march=pentium4 -
mtune=pentium4 -Wall -Wno-pointer-sign -MT gpgkeys_curl-gpgkeys_curl.o -MD -MP -
MF .deps/gpgkeys_curl-gpgkeys_curl.Tpo -c -o gpgkeys_curl-gpgkeys_curl.o `test -
f 'gpgkeys_curl.c' || echo '../../gnupg-1.4.9/keyserver/'`gpgkeys_curl.c../../
gnupg-1.4.9/keyserver/gpgkeys_curl.c: In function 'main':
../../gnupg-1.4.9/keyserver/gpgkeys_curl.c:304: error: 'typeof' applied to a
bit-field
../../gnupg-1.4.9/keyserver/gpgkeys_curl.c:304: error: 'typeof' applied to a
bit-field
...

The line 304 in the file gpgkeys_curl.c -

curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,opt->flags.check_cert);

I think, because of the following macroses in the /usr/local/include/curl/
typecheck-gcc.h

#define curl_easy_setopt(handle, option, value) \
extension ({ \

__typeof__ (option) _curl_opt = option;                                     \
if (__builtin_constant_p(_curl_opt)) {                                      \
  if (_curl_is_long_option(_curl_opt) && !_curl_is_long(value))             \
    _curl_easy_setopt_err_long();                                           \

...
#define _curl_is_long(expr) \

(__builtin_types_compatible_p(__typeof__(expr), long) ||                    \
 __builtin_types_compatible_p(__typeof__(expr), signed long) ||             \
 __builtin_types_compatible_p(__typeof__(expr), unsigned long) ||           \

...

typeof applies to opt->flags.check_cert (check_cert is a bit field) that
leads to the errors.

The file /usr/local/include/curl/typecheck-gcc.h included from
/usr/local/include/curl/curl.h included from
gnupg-1.4.9/keyserver/gpgkeys_curl.c
with following directives:
#ifdef HAVE_LIBCURL
#include <curl/curl.h>
#else
#include "curl-shim.h"
#endif

My OS and other info:
OS: SunOS solaris 5.11 snv_97 i86pc i386 i86pc Solaris
GCC: gcc (GCC) 4.3.1
ld: GNU ld (GNU Binutils) 2.18
libcurl: http://curl.haxx.se/download/curl-7.19.0.tar.bz2

Details

Version
1.4.9

Event Timeline

eugene added projects: gnupg, Bug Report.
eugene added a subscriber: eugene.
werner claimed this task.

That has been fixed in the SVn for some time:

2008-04-14 David Shaw <dshaw@jabberwocky.com>

  • gpgkeys_curl.c (main), gpgkeys_hkp.c (main): Make sure all

libcurl number options are passed as long.

That is cast the bitfield to a long.