From owner-freebsd-current@FreeBSD.ORG Wed Jul 16 11:32:50 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91C9837B401 for ; Wed, 16 Jul 2003 11:32:50 -0700 (PDT) Received: from lifesupport.shutdown.com (dsl092-048-059.sfo2.dsl.speakeasy.net [66.92.48.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id B7E5C43FA3 for ; Wed, 16 Jul 2003 11:32:49 -0700 (PDT) (envelope-from llewelly@lifesupport.shutdown.com) Received: (from llewelly@localhost) by lifesupport.shutdown.com (8.11.2/8.11.2) id h6GISQs05514; Wed, 16 Jul 2003 11:28:26 -0700 (PDT) To: Wesley Morgan References: <20030716145027.GU1226@unixpages.org> <20030716120739.R92331@volatile.chemikals.org> From: LLeweLLyn Reese Date: 16 Jul 2003 11:28:25 -0700 In-Reply-To: <20030716120739.R92331@volatile.chemikals.org> Message-ID: Lines: 28 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: current@freebsd.org Subject: Re: world breakage in pam_echo X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 18:32:50 -0000 Wesley Morgan 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 )