From owner-svn-src-head@FreeBSD.ORG Tue Oct 9 20:24:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8254725C for ; Tue, 9 Oct 2012 20:24:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 41A408FC16 for ; Tue, 9 Oct 2012 20:24:30 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so6210664pad.13 for ; Tue, 09 Oct 2012 13:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Ca0OYCi/v0MHzglnMQ4zy9jxV6ZpsY+v8vX9YBHgEUo=; b=Zc82K1IXO4iBCtL2d0YNLl7x7emCuNa1s4E1SpJVLhJKaAsHk+CvROnqSZj7Hqs8GI UkVZjDkIyzlA1aLdk3MP2M+IC289/8b+P8fjHhZ6MN6KSPvXPZiAfncAeMmR5HZaYfA7 KDjE27TJ/MwE3naqLJ+Zwb/khrWfGWB1W+S/o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Ca0OYCi/v0MHzglnMQ4zy9jxV6ZpsY+v8vX9YBHgEUo=; b=hHEGa4Cwoq4qyHMdD0F9WtYpKN77ShTBlTRqeiXa+e9DJr/QzQvW6btRnHuCjX7vsJ cKzj2wzt93Tkwmrhj5aHK4BTR3MJ24eoDYic+EepUtMmp4n0a4j8eHUZRiTXzfbEgWLy QaqC8m9dEDQ+nHD/oSKbYOxpM5Gi8pafvM8t5VeBVadZlM8ge0ADPZVnoxjqrUMB8ev3 OcS3f6DhL4SHtQdytm8SZzLi+JqJHnqwKD0+sLRy/KFvV40Mn5QpASSkaMEr189jh5E9 WbHcz0kitaY/QE1iqyNO/bL6cMTzyaMCjZBVGGT0uimn3HV6lwcUrFGOJfIdl10kEa7d DDvg== Received: by 10.68.129.72 with SMTP id nu8mr66337044pbb.29.1349814269855; Tue, 09 Oct 2012 13:24:29 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.161.163 with HTTP; Tue, 9 Oct 2012 13:23:59 -0700 (PDT) In-Reply-To: <50746BF8.5010307@freebsd.org> References: <201210091425.q99EPFS6020787@svn.freebsd.org> <507451DE.9060909@freebsd.org> <50746BF8.5010307@freebsd.org> From: Eitan Adler Date: Tue, 9 Oct 2012 16:23:59 -0400 X-Google-Sender-Auth: 8QxLwMsR5cHvBMqOH7svtbGDxjI Message-ID: Subject: Re: svn commit: r241373 - head/lib/libc/stdlib To: Andrey Chernov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkbSeBrQPd5ysPo1GhGGjjKTrD38Xtiknw/hpk47gMJiCjENWA/GyO+qMjT4a19zWLcZKZ0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, theraven@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 20:24:30 -0000 On 9 October 2012 14:24, Andrey Chernov wrote: > I don't have ISO9899 nearby, could you directly quote mentioned > sections, please? Accesses to volatile object (a) produce side effects (b) have implementation defined values. A more careful re-reading of the relevant section leads me to believe I may have been wrong with this comment. It isn't made explicit, but the C standard never says that accesses to uninitialized volatile is defined. On the other hand, the existence of "const volatile" proves me wrong. Interestingly, clang and gcc disagree on whether to warn: [8084 eitan@radar ~ ]%gcc46 -Wall -Wextra -ansi -pedantic a.c [8089 eitan@radar ~ ]%clang -Wall -Wextra -ansi -pedantic a.c a.c:3:9: warning: variable 'a' is uninitialized when used here [-Wuninitialized] I still don't like volatile though here for the other reasons mentioned. In general, the entire piece of code should be replaced with something that can't fail, so this is a moot point. > Do you against 'volatile' usage at all? It seems whole > kernel (see above) contradicts with such point of view. Not, I never said any such thing. Volatile is designed for memory mapped I/O and it makes sense to use for such things. I haven't audited every use of 'volatile' though. -- Eitan Adler Source & Ports committer X11, Bugbusting teams