From owner-svn-src-head@freebsd.org Fri Jan 19 04:55:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA29CEC251A; Fri, 19 Jan 2018 04:55:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA71871C53; Fri, 19 Jan 2018 04:55:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id 196so724990iti.5; Thu, 18 Jan 2018 20:55:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=nsleg3jY2ZMr5ae5PzmPlWl7i7T8iRG89kbWOencwgs=; b=aVfBS8o7lgGzgd6Gaj7R0W2IHAoLNmL23x2Z73fYVv0Hg4fH5ezUhMcA1+rrOBRjgb dBkt/jVaG6kDAneGnQz7Px3/ia/WZAbTVQW7qPAhzugnFR7pkNFBhAz/FiVo8EzQbeN9 xhoz0DeqzrDh+Fclq5h6voCcgMTLRsVSTu+tdH9uV+t464wshEPzX6HpEEXd9SOoVkQE sEi5jcmVoHFhZRyQxCnrMIDlg8/OXJiUf8g7ALiPg0LWi6GJeeLXoBAdqzxMaVVkmKDE tBFh6NAPmKLzEShekkmudirXSBkfRLNy93QuJlkWJ1S77x//nlWs2/TWqcFIj7Pf6VqJ pDjQ== X-Gm-Message-State: AKwxytemhTlTs/bWU0KLOmQyjYeF6Wv7r7+55Afh6mFgI6B8gpylqJ+J 2BT8hvXogNXqcBULQ1Bdc7xs1s9D X-Google-Smtp-Source: ACJfBostOY4NtQN79PdKbr7r9Sna7uWrdC1PTlTz+870kWvnbJxgbsh0cwywHYusZ/a7aIRLl8d3aA== X-Received: by 10.36.163.136 with SMTP id p130mr13219823ite.49.1516337383562; Thu, 18 Jan 2018 20:49:43 -0800 (PST) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id j3sm3658133iob.14.2018.01.18.20.49.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 20:49:43 -0800 (PST) Received: by mail-it0-f49.google.com with SMTP id p124so736370ite.1; Thu, 18 Jan 2018 20:49:43 -0800 (PST) X-Received: by 10.36.137.84 with SMTP id s81mr2976669itd.75.1516337382959; Thu, 18 Jan 2018 20:49:42 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Thu, 18 Jan 2018 20:49:42 -0800 (PST) In-Reply-To: References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> From: Conrad Meyer Date: Thu, 18 Jan 2018 20:49:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: Benjamin Kaduk Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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: Fri, 19 Jan 2018 04:55:15 -0000 No. It is the only logical result of a logical right shift larger than the left operand. The C standard may claim that is undefined, but that does not change the only logical result (zero). On Thu, Jan 18, 2018 at 8:38 PM, Benjamin Kaduk wrote: > On Thu, Jan 18, 2018 at 10:34 PM, Conrad Meyer wrote: >> >> Author: cem >> Date: Fri Jan 19 04:34:06 2018 >> New Revision: 328159 >> URL: https://svnweb.freebsd.org/changeset/base/328159 >> >> Log: >> Unbreak i386 build >> >> The logical result of a right shift >= the width of a type is zero, but >> our >> compiler decides this is a warning (and thus, error). Just remove >> ccp(4) >> from i386. > > > That may seem like the logical result, but this is actually undefined > behavior. Per n1256.pdf, section 6.5.7: > > The integer promotions are performed on each of the operands. The type of > the result is that of the promoted left operand. If the value of the right > operand is negative or is greater than or equal to the width of the promoted > left operand, the behavior is undefined. > > -Ben