Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 217129 - gcc's cpp preprocessor loses some #defines
Summary: gcc's cpp preprocessor loses some #defines
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-10 12:57 UTC by Aldo Cassola
Modified: 2008-04-10 20:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aldo Cassola 2008-04-10 12:57:48 UTC
After trying to emerge elfutils (which crashed because ARGP_KEY_FINI was seen by the compiler as undeclared) and digging through the code, I created this mall snippet of code to test whether sanity was present:

FILE - foo.c
--------------------
#include <argp.h>

int main (void) {
        ARGP_KEY_FINI;

        return 0;
}
-------------------------

Running 'cpp foo.c' leaves ARGP_KEY_FINI, but it is #defined in argp.h!

I tested this against gcc 3.3.6 and 4.2.3.

Reproducible: Always

Steps to Reproduce:
1. Create foo.c as described above
2. cpp foo.c

Actual Results:  
ARGP_KEY_FINI is still there

Expected Results:  
The value of ARGP_KEY_FINI should appear in the preprocessed file, not its symbol

emerge --info follows

Portage 2.1.5_rc2 (default-linux/x86/2007.0/desktop, gcc-4.2.3, glibc-2.7-r2, 2.6.24-tuxonice-r4-lean i686)
=================================================================
System uname: 2.6.24-tuxonice-r4-lean i686 Genuine Intel(R) CPU T2300 @ 1.66GHz
Timestamp of tree: Wed, 09 Apr 2008 04:02:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.1-r5
sys-apps/baselayout: 1.12.12
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://rsync.namerica.gentoo.org http://mirror.datapipe.net/gentoo http://gentoo.mirrors.tds.net/gentoo http://gentoo.chem.wisc.edu/gentoo/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS=""
LINGUAS="en es"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi aim akode alsa amarok apache2 arts asm avahi avi berkdb bitmap-fonts bzip2 cairo cddb cdparanoia cdr cdrom cli cracklib crypt cups dbus dlloader doc dri dts dvd dvdr dvdread dvi eap-tls eds emboss encode esd evo exif fam fbsplash ffmpeg firefox flac flash foomaticdb fortran gdbm gif gimp gimpprint glitz gnome gnutls gpm gstreamer gtk gtk2 hal iconv ipod ipv6 isdnlog jpeg kde kerberos ldap libg++ mad matroska midi mikmod mmx mmxext mp3 mp4 mpeg mpeg2 mplayer mudflap musicbrainz ncurses nls nptl nptlonly nsplugin offensive ogg opengl openmp openssl opensslcrypt oss pam pcre pdf pdflib perl png ppds pppd python qt3 qt3support qt4 quicktime readline reflection samba sdl session spell spl sse sse2 ssl subtitles svg svga tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode usb v4l vorbis win32codecs x86 xine xml xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en es" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2008-04-10 20:08:09 UTC
works fine for me:

$ echo '#include <argp.h>' | gcc -E -dD - | grep ARGP_KEY_FINI
#define ARGP_KEY_FINI 0x1000007

i'm guessing you have an invalid argp.h installed somewhere that is screwing you up.  look at the output to figure out what argp.h header is being included.