From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 30 16:12:55 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 450E4106564A; Sun, 30 Oct 2011 16:12:55 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 05AE08FC1D; Sun, 30 Oct 2011 16:12:54 +0000 (UTC) Received: by iaky10 with SMTP id y10so9443270iak.13 for ; Sun, 30 Oct 2011 09:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Lv/xW8sPiTB7xklWHOlQegs4SsYtjzlAtmfaJPH+cko=; b=e/aOiP40s5cEKIM4loR2ide9LQT0UjwmZG4RW6BnvzPnfzUgI5MWI5y51rmpONXJmn BROBaOy6N7gatClgIWDIw3rlcE5ZgO8dHO5kJpZqMfFyJ0+PEGMz++QrUDuJqYB+gK2O RJrCAMtLLvXL2eTGkdNl0iHtJnGz6+vrypZG0= MIME-Version: 1.0 Received: by 10.68.29.101 with SMTP id j5mr17280446pbh.61.1319991173965; Sun, 30 Oct 2011 09:12:53 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.57.40 with HTTP; Sun, 30 Oct 2011 09:12:53 -0700 (PDT) In-Reply-To: <1598895785.20111030200659@serebryakov.spb.ru> References: <1598895785.20111030200659@serebryakov.spb.ru> Date: Sun, 30 Oct 2011 09:12:53 -0700 X-Google-Sender-Auth: hbmWy_xgae3KAOuz82nKFa4fiog Message-ID: From: mdf@FreeBSD.org To: lev@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: How to remopve "volatile" qualifier from pointer without warning from gcc? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 16:12:55 -0000 2011/10/30 Lev Serebryakov : > Hello, Hackers. > > =A0I need to pass "volatile void *" to API function, which takes > "void*". gcc (on FreeBSD 8.2) emits warning, and as in FreeBSD-styed > code warnings are treated as errors, program could not be built. > > =A0Manual casting gives warning, too... See the __DEVOLATILE() hack that will do sufficient casting to silence the compiler. As with any compiler warning, silencing it incorrectly comes with a risk... Cheers, matthew