From owner-cvs-all Sat Sep 15 7: 6:53 2001 Delivered-To: cvs-all@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id D41E937B40B; Sat, 15 Sep 2001 07:06:46 -0700 (PDT) Received: by bazooka.unixfreak.org (Postfix, from userid 1000) id C64EE3E28; Sat, 15 Sep 2001 07:06:46 -0700 (PDT) Received: from bazooka.unixfreak.org (localhost [127.0.0.1]) by bazooka.unixfreak.org (Postfix) with ESMTP id B3E5F3C12E; Sat, 15 Sep 2001 07:06:46 -0700 (PDT) To: Dag-Erling Smorgrav Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/syslogd Makefile syslogd.c In-Reply-To: ; from des@ofug.org on "15 Sep 2001 15:59:43 +0200" Date: Sat, 15 Sep 2001 07:06:41 -0700 From: Dima Dorfman Message-Id: <20010915140646.C64EE3E28@bazooka.unixfreak.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dag-Erling Smorgrav wrote: > Dima Dorfman writes: > > - Apply WARNS=1. WARNS=2 was not used because this program assigns > > string literals to (struct iovec).iov_base for writing, and the only > > clean way to silence -Wwrite-strings in that case would be to > > strdup() and consequently free() those literals, which I considered > > too disruptive. > > (const char *)iov.iov_base = "foo"; This is a GCC'ism. I actually did this, but bde didn't like it too much, and I decided that WARNS=1 without GCC'isms was better than WARNS=2 with GCC'isms. > Other possible solutions include creating a "shadow" struc iov that > declares iov_base as const char * and can only be used for writing, or > fixing up struct iov to make iov_base a union (with appropriate > compatibility macros) with both char * and a const char * members. This has been suggested before, but I don't remember why (if?) it was rejected. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message