# emerge --info Portage 2.1-r1 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.16-gentoo-r9 i686) ================================================================= System uname: 2.6.16-gentoo-r9 i686 Celeron (Mendocino) Gentoo Base System version 1.6.15 dev-lang/python: 2.4.2 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r2 sys-devel/gcc-config: 1.3.13-r2 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-Os -march=i686 -pipe -momit-leaf-frame-pointer -fomit-frame-pointer -fweb -frename-registers" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib/X11/xkb" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-Os -march=i686 -pipe -momit-leaf-frame-pointer -fomit-frame-pointer -fweb -frename-registers" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://adelie.polymtl.ca/ ftp://cs.ubishops.ca/pub/gentoo ftp://gentoo.arcticnetwork.ca/pub/gentoo/ http://gentoo.arcticnetwork.ca/ http://gentoo.mirrored.ca/ ftp://gentoo.mirrored.ca/ " LANG="en_CA.utf8" LC_ALL="en_CA.utf8" LINGUAS="en" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="x86 3dfx X acpi alsa apache2 avi bitmap-fonts bzip2 cli crypt dga dri dvd fam gdbm gif gimp glibc-omitfp gmp gstreamer gtk gtk2 hpn idea isdnlog java javascript jpeg libg++ libwww mmx mpeg ncurses nls nptl nptlonly nsplugin opengl pam pcre pdflib png pppd qt quicktime readline reflection samba scanner sdl session spell spl ssl symlink truetype truetype-fonts type1-fonts ucs2 udev unicode usb userlocales voodoo3 xml xml2 xmms xorg xscreensaver xv zlib elibc_glibc kernel_linux linguas_en userland_GNU" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS # gcc --version gcc (GCC) 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # cat helper2.c #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <fcntl.h> #include <unistd.h> #include <linux/ppdev.h> #include <linux/parport.h> int open_device(const char *dev) { int handle; int arg; handle = open(dev, O_RDWR); if (handle < 0) { return -1; } if (ioctl(handle, PPEXCL) < 0) { close(handle); return -1; } if (ioctl(handle, PPCLAIM) < 0) { close(handle); return -1; } arg = IEEE1284_MODE_COMPAT; if (ioctl(handle, PPSETMODE, &arg) < 0) { ioctl(handle, PPRELEASE); close(handle); /* LINE 28 */ return -1; } arg = 0; if (ioctl(handle, PPSETFLAGS, &arg) < 0) { ioctl(handle, PPRELEASE); close(handle); /* LINE 34 */ return -1; } arg = 0; if (ioctl(handle, PPDATADIR, &arg) < 0) { ioctl(handle, PPRELEASE); close(handle); return -1; } return handle; } # gcc -olibLPTLinux-Helper.so -pipe -ansi -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wold-style-definition -Wpacked -Wnested-externs -Wunreachable-code -Wstack-protector -g0 -Os -s -fpic -fstack-protector-all -fno-leading-underscore -shared helper2.c helper2.c: In function `open_device': helper2.c:34: warning: will never be executed helper2.c:28: warning: will never be executed The relevant lines have been commented in the source listing above. This output is clearly wrong; the ioctl() function will return and close() will be invoked. I have absolutely no idea why GCC would say this, it makes no sense to me.
this has been fixed in gcc-4.x so really this is going to stay broken forever