From owner-svn-src-all@FreeBSD.ORG Tue Jun 15 08:10:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 579AC106567B; Tue, 15 Jun 2010 08:10:35 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1258FC29; Tue, 15 Jun 2010 08:10:33 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA18267; Tue, 15 Jun 2010 11:10:31 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OORE7-000Ckv-3i; Tue, 15 Jun 2010 11:10:31 +0300 Message-ID: <4C173575.1080003@freebsd.org> Date: Tue, 15 Jun 2010 11:10:29 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Kostik Belousov References: <201006150706.o5F76sLF004481@svn.freebsd.org> <20100615080309.GK13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100615080309.GK13238@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209193 - head/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 08:10:35 -0000 on 15/06/2010 11:03 Kostik Belousov said the following: > On Tue, Jun 15, 2010 at 07:06:54AM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Tue Jun 15 07:06:54 2010 >> New Revision: 209193 >> URL: http://svn.freebsd.org/changeset/base/209193 >> >> Log: >> sound/pcm: use non-const string as a value with SYSCTL_STRING >> >> Although the sysctls are marked with CTLFLAG_RD and the values will stay >> immutable, current sysctl implementation stores value pointer in >> void* type, which means that const qualifier is discarded anyway >> and some newer compilers complaint about that. >> We can't use de-const trick in sysctl implementation, because in that >> case we could miss an opposite situation where a const value is used >> with CTLFLAG_RW sysctl. >> >> Complaint from: gcc 4.4, clang >> MFC after: 2 weeks > This is arguably the change for worse then better. Arguably - yes, practically - I am not sure. See almost every other instance of SYSCTL_STRING usage, kern_mib.c most prominently. > You could add SYSCTL_STRING_CONST or the like instead. But we already have CTLFLAG_RD vs CTLFLAG_RW... Perhaps, we could have a union of void* and const void* and then assign value to the appropriate member based on the flags. But I am not sure if the benefit would be worth the effort. -- Andriy Gapon