Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 216809

Summary: gnupg-2.0.7 + curl-7.18.1 + gcc-4.3
Product: Gentoo Linux Reporter: Ryan Hill (RETIRED) <rhill>
Component: [OLD] GCC PortingAssignee: Crypto team [DISABLED] <crypto+disabled>
Status: RESOLVED FIXED    
Severity: minor CC: bkohler, dragonheart, ganguin, ingmar
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 198121    
Attachments: Gnupg patch for curl/gcc 4.3
Ebuild patch for gnupg-2.0.9

Description Ryan Hill (RETIRED) gentoo-dev 2008-04-08 02:33:02 UTC
Heys.  There is a compilation error building gnupg-2.0.9 using GCC
4.3 and curl-7.18.1.  The error appears to be the result of this change
from the curl release announcement:

- added type checking macros for curl_easy_setopt() and
curl_easy_getinfo(), watch out for new warnings in code using libcurl
(needs gcc-4.3 and currently only works in C mode)

http://curl.haxx.se/mail/lib-2008-02/0267.html
http://curl.haxx.se/mail/lib-2008-02/0292.html

i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..   -I../gl -I../common -I../intl -DLOCALEDIR\"/usr/share/locale\" -DGNUPG_BINDIR="\"/usr/bin\"" -DGNUPG_LIBEXECDIR="\"/usr/libexec\"" -DGNUPG_LIBDIR="\"/usr/lib/gnupg\"" -DGNUPG_DATADIR="\"/usr/share/gnupg\"" -DGNUPG_SYSCONFDIR="\"/etc/gnupg\""         -O2 -g -march=prescott -fomit-frame-pointer -pipe -fdirectives-only -Wall -Wno-pointer-sign -Wpointer-arith -MT gpg2keys_curl-gpgkeys_curl.o -MD -MP -MF .deps/gpg2keys_curl-gpgkeys_curl.Tpo -c -o gpg2keys_curl-gpgkeys_curl.o `test -f 'gpgkeys_curl.c' || echo './'`gpgkeys_curl.c
gpgkeys_curl.c: In function 'main':
gpgkeys_curl.c:303: error: 'typeof' applied to a bit-field


I've sent this to the gnupg-dev mailing list but I'm not sure if it went through.  I'll try again in a bit if it doesn't show up.

In the meantime, I don't know how to fix this correctly and haven't seen it reported elsewhere yet.  As you're probably more familiar with the codebase, let me know if you have any ideas.
Comment 1 Michel Ganguin 2008-04-10 12:21:24 UTC
Strange error!!! GCC error?

since the third param of curl_easy_setopt is boolean in this case (according to "man curl_easy_setopt") you can put a double not (!) to fix the compilation error.

gpgkeys_curl.c:303:
-curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,opt->flags.check_cert);
+curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,!!opt->flags.check_cert);
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2008-04-10 12:26:11 UTC
(In reply to comment #1)
> gpgkeys_curl.c:303:
> -curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,opt->flags.check_cert);
> +curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,!!opt->flags.check_cert);

Better solution would be:
+curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER, opt->flags.check_cert != 0);
Comment 3 maquiz@zonnet.nl 2008-04-16 20:30:24 UTC
Created attachment 149978 [details, diff]
Gnupg patch for curl/gcc 4.3

Patch to correct gcc 4.3 compile error
Comment 4 maquiz@zonnet.nl 2008-04-16 20:30:59 UTC
Created attachment 149979 [details]
Ebuild patch for gnupg-2.0.9

Ebuild patch
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2008-04-17 05:15:48 UTC
Fixed, thanks!
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2008-04-24 01:57:18 UTC
Just FYI, this is fixed upstream.

http://lists.gnupg.org/pipermail/gnupg-devel/2008-April/024344.html