Date: 16 Jul 2003 11:28:25 -0700 From: LLeweLLyn Reese <llewelly@lifesupport.shutdown.com> To: Wesley Morgan <morganw@chemikals.org> Cc: current@freebsd.org Subject: Re: world breakage in pam_echo Message-ID: <x3el0qxr5i.fsf@lifesupport.shutdown.com> In-Reply-To: <20030716120739.R92331@volatile.chemikals.org> References: <20030716145027.GU1226@unixpages.org> <20030716120739.R92331@volatile.chemikals.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Wesley Morgan <morganw@chemikals.org> writes: > On Wed, 16 Jul 2003, Christian Brueffer wrote: > > > ===> lib/libpam/modules/pam_echo > > cc -O2 -pipe -march=pentium2 -I/usr/src/lib/libpam/modules/pam_echo/../../../../contrib/openpam/include -I/usr/src/lib/libpam/modules/pam_echo/../../libpam -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wno-uninitialized -c /usr/src/lib/libpam/modules/pam_echo/pam_echo.c > > /usr/src/lib/libpam/modules/pam_echo/pam_echo.c: In function `_pam_echo': > > /usr/src/lib/libpam/modules/pam_echo/pam_echo.c:92: warning: dereferencing type-punned pointer will break strict-aliasing rules > > *** Error code 1 > > I was just about to report this myself. The breakage only occurs with > optimization levels of -O2 (and maybe higher). Officially -O2 is not > supported for world, but in my experience there are real problems with > code (warnings in this case) that do not show up until the optimizer takes > a closer look at them. [snip] It's my impression that these warnings mean the C code in question is undefined or implementation-defined according to the C standard, and the generated assembler may have unexpected behavior. I get this impression from reading the description of -fstrict-aliasing (enabled at -O2, -O3, -Os) at: http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Optimize-Options.html#Optimize%20Options (The relevant warning flag is -Wstrict-aliasing, see http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Warning-Options.html#Warning%20Options )
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?x3el0qxr5i.fsf>