From nobody@FreeBSD.org  Sat Jan  1 07:02:11 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6AA1816A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  1 Jan 2005 07:02:11 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5192D43D31
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  1 Jan 2005 07:02:11 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0172Bf8024087
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 1 Jan 2005 07:02:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j0172B17024086;
	Sat, 1 Jan 2005 07:02:11 GMT
	(envelope-from nobody)
Message-Id: <200501010702.j0172B17024086@www.freebsd.org>
Date: Sat, 1 Jan 2005 07:02:11 GMT
From: Yuri <yuri@tsoft.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: -O5 flag breaks some compiles in /usr/src/lib/libc
X-Send-Pr-Version: www-2.3

>Number:         75702
>Category:       kern
>Synopsis:       [libc] -O5 flag breaks some compiles in /usr/src/lib/libc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    dwmalone
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 01 07:10:17 GMT 2005
>Closed-Date:    Sat Aug 16 14:26:41 UTC 2008
>Last-Modified:  Sat Aug 16 14:26:41 UTC 2008
>Originator:     Yuri
>Release:        5.3-STABLE-i386
>Organization:
N/A
>Environment:
FreeBSD xxx.xxx.xxx 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov  5 04:19:18 UTC 2004     root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
When /etc/make.conf has high optimization option set (CFLAGS=-O5)
some of compiles break.

example:
cc -O5  -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/i386 -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa -DINET6 -I/usr/obj/usr/src/lib/libc -DPOSIX_MISTAKE -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DHESIOD -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /usr/src/lib/libc/rpc/getpublickey.c

gives an warning equal to error (due to -Werror):
/usr/src/lib/libc/rpc/getpublickey.c: In function `getpublickey':
/usr/src/lib/libc/rpc/getpublickey.c:69: warning: passing arg 1 of `__getpublickey_real' discards qualifiers from pointer target type


but there are many more similar warnings/errors
>How-To-Repeat:
add line 
CFLAGS=-O5
to the file /etc/make.conf

and run "make buildworld" from /usr/src
>Fix:
N/A
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: simon 
State-Changed-When: Sat Jan 1 13:30:45 GMT 2005 
State-Changed-Why:  
Quoting from /usr/share/examples/etc/make.conf : 

# Note that optimization settings other than -O and -O2 are not recommended 
# or supported for compiling the world or the kernel - please revert any 
# nonstandard optimization settings to "-O" before submitting bug reports 
# without patches to the developers. 

A lot of other things are also likely to break at higher optimization 
levels, which is why it is not supported. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75702 
State-Changed-From-To: closed->open 
State-Changed-By: dwmalone 
State-Changed-When: Sat Jan 1 14:43:55 GMT 2005 
State-Changed-Why:  
Though Simon is correct, that we do not support optimisation settings 
other than -O and -O2, the warning listed in the PR is a constness 
warning that we can probably fix. I'm interested in doing that, so 
I'll take the PR. 

David. 


Responsible-Changed-From-To: freebsd-bugs->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Sat Jan 1 14:43:55 GMT 2005 
Responsible-Changed-Why:  
Though Simon is correct, that we do not support optimisation settings 
other than -O and -O2, the warning listed in the PR is a constness 
warning that we can probably fix. I'm interested in doing that, so 
I'll take the PR. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75702 

From: Bruce Cran <bruce@cran.org.uk>
To: bug-followup@FreeBSD.org, yuri@tsoft.com
Cc:  
Subject: Re: kern/75702: [libc] -O5 flag breaks some compiles in /usr/src/lib/libc
Date: Thu, 28 Feb 2008 21:35:01 +0000

 Hi,
 
 This was fixed in rev 1.9 of getpublickey.c, which is in FreeBSD 7.0.
 
  From the commit log:
 "Const'ify arguments to a couple of functions to fix breakage with -O2."
 
 --
 Bruce
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Thu Feb 28 21:44:10 UTC 2008 
State-Changed-Why:  
Apparently needs MFC. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75702 
State-Changed-From-To: patched->closed 
State-Changed-By: dwmalone 
State-Changed-When: Sat Aug 16 14:25:47 UTC 2008 
State-Changed-Why:  
Now in FreeBSD 7. The fix is code cleanup, so it doesn't really need 
to be merged to 6. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75702 
>Unformatted:
