From avn@ns.any.ru  Mon May 21 02:24:12 2001
Return-Path: <avn@ns.any.ru>
Received: from ns.any.ru (ns.any.ru [194.67.127.11])
	by hub.freebsd.org (Postfix) with ESMTP id 9307037B424
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 May 2001 02:24:01 -0700 (PDT)
	(envelope-from avn@ns.any.ru)
Received: (from avn@localhost)
	by ns.any.ru (8.11.3/8.11.3) id f4L9M2N39761
	for FreeBSD-gnats-submit@freebsd.org.AVP; Mon, 21 May 2001 13:22:02 +0400 (MSD)
	(envelope-from avn)
Received: (from avn@localhost)
	by ns.any.ru (8.11.3/8.11.3) id f4L9M2S39752;
	Mon, 21 May 2001 13:22:02 +0400 (MSD)
	(envelope-from avn)
Message-Id: <200105210922.f4L9M2S39752@ns.any.ru>
Date: Mon, 21 May 2001 13:22:02 +0400 (MSD)
From: avn@any.ru
Reply-To: avn@any.ru
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: syslog.h fails to compile with -Wwrite-strings
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         27492
>Category:       misc
>Synopsis:       syslog.h fails to compile with -Wwrite-strings
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    dwmalone
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 21 02:30:02 PDT 2001
>Closed-Date:    Tue May 29 06:18:01 PDT 2001
>Last-Modified:  Tue May 29 06:18:34 PDT 2001
>Originator:     Alexey V. Neyman
>Release:        FreeBSD 4.3-STABLE
>Organization:
ANY.RU
>Environment:
FreeBSD srv2.any 4.3-STABLE FreeBSD 4.3-STABLE #2: Thu May 17 19:01:42 MSD 2001
    toor@srv2.any:/usr2/obj/usr2/src/sys/SRV2  i386
>Description:
>How-To-Repeat:
$cat > a.c
#define SYSLOG_NAMES
#include <stdio.h>
#include <syslog.h>
int main(void) {return 0;}
^D
$gcc -Wwrite-strings -Werror a.c
In file included from a.c:3:
/usr/include/syslog.h:76: warning: initialization discards qualifiers from point
er target type
[ ... many more warnings skipped ... ]
>Fix:

--- syslog.h.orig	Mon May 21 13:04:27 2001
+++ syslog.h	Mon May 21 13:05:19 2001
@@ -68,8 +68,8 @@
 				/* mark "facility" */
 #define	INTERNAL_MARK	LOG_MAKEPRI((LOG_NFACILITIES<<3), 0)
 typedef struct _code {
-	char	*c_name;
-	int	c_val;
+	const char	*c_name;
+	int		c_val;
 } CODE;
 
 CODE prioritynames[] = {
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Mon May 21 02:36:53 PDT 2001 
Responsible-Changed-Why:  
I'll have a look at this. I'll have to check what the knock on effects are. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27492 

From: Peter Pentchev <roam@orbitel.bg>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: misc/27492: syslog.h fails to compile with -Wwrite-strings
Date: Mon, 21 May 2001 12:41:25 +0300

 On Mon, May 21, 2001 at 02:37:56AM -0700, dwmalone@FreeBSD.org wrote:
 > Synopsis: syslog.h fails to compile with -Wwrite-strings
 > 
 > Responsible-Changed-From-To: freebsd-bugs->dwmalone
 > Responsible-Changed-By: dwmalone
 > Responsible-Changed-When: Mon May 21 02:36:53 PDT 2001
 > Responsible-Changed-Why: 
 > I'll have a look at this. I'll have to check what the knock on effects are.
 
 I have been running with a similar patch for the last month or three.
 No side effects have occurred so far - I think nobody (or no program ;)
 in their right mind would actually try to modify the fac/pri names anyway :)
 
 G'luck,
 Peter
 
 -- 
 I am the meaning of this sentence.
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Mon May 21 10:32:55 PDT 2001 
State-Changed-Why:  
committed, thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27492 
State-Changed-From-To: closed->open 
State-Changed-By: dwmalone 
State-Changed-When: Mon May 21 11:43:40 PDT 2001 
State-Changed-Why:  
I think this may cause knock-on constness warnings in syslogd, 
libwrap and friends. I'm reopening the PR to remind myself to do 
this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27492 
State-Changed-From-To: open->closed 
State-Changed-By: dwmalone 
State-Changed-When: Tue May 29 06:18:01 PDT 2001 
State-Changed-Why:  
Patch now in -current and -stable. Thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27492 
>Unformatted:
