From owner-svn-src-head@freebsd.org Fri Jan 19 05:07:22 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 35711EC2C65; Fri, 19 Jan 2018 05:07:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (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 055E67229F; Fri, 19 Jan 2018 05:07:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id w14so754411itc.3; Thu, 18 Jan 2018 21:07:21 -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=VN6QRj0P6GTKN9JUeTBjSFeJyFcJtMtRCzvOvGO9yhE=; b=iN61fbrYdEQ0wM3j0k11eQPcHSqqRO6fJa7hpQd1RdZV6OICZy094S/yx0PqmafGcQ SkL4AKS3lWsO7hYD/Z2j3CoPp8GGd4CS5mpfP0g9Z1phK7v/e91gKz5zWSYfdLrprQfp LoTlikXqBZT/pPinwn+G+/wslfd9RhdJZAEbjhHzgHZVUXx1xrJZrdksFzwociG1/1Lo INGv/4OX0xmRk927ELutL6zHGoAW9PNlwjaXpRskI+f3ged7xn7aFaVRZDmA2k+0zhMD ogklFbv8Lg+UQWfZWCp1Bv9PAPxMo1zMKME+fHRxWD1sZ30WUjHiTDSoN85N5xTb2D+j X0Bg== X-Gm-Message-State: AKwxyteho6p2+8wOqmYekLyoovg5tDyIFJfvJN6qxkZCDzhg1ynIrmDL +qIt1ws5K3DKyIYyU3YwzrWG/Ugv X-Google-Smtp-Source: ACJfBot8LRWSgOg5ogsr495N+3W5/J9uWnCDDpKicwjq/KmEDZVyLChzDt7NAXa1IhcztanJnls8Fw== X-Received: by 10.36.117.195 with SMTP id y186mr27896465itc.111.1516338440622; Thu, 18 Jan 2018 21:07:20 -0800 (PST) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id b69sm1415090ioa.65.2018.01.18.21.07.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 21:07:20 -0800 (PST) Received: by mail-io0-f172.google.com with SMTP id 25so896634ioj.9; Thu, 18 Jan 2018 21:07:20 -0800 (PST) X-Received: by 10.107.6.130 with SMTP id f2mr28456387ioi.117.1516338440122; Thu, 18 Jan 2018 21:07:20 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Thu, 18 Jan 2018 21:07:19 -0800 (PST) In-Reply-To: References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> From: Conrad Meyer Date: Thu, 18 Jan 2018 21:07:19 -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 05:07:22 -0000 The spec says the behavior is undefined; not that the compiler has to produce a warning or error message. The compiler *does* get to arbitrarily decide what it wants to do when it encounters UB. It is wholly free to implement this particular UB with the logical result and no warning/error. On Thu, Jan 18, 2018 at 8:54 PM, Benjamin Kaduk wrote: > On Thu, Jan 18, 2018 at 10:49 PM, Conrad Meyer wrote: >> >> 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). >> > > My point is that the compiler does not arbitrarily decide that this behavior > merits > a warning; the compiler is thoroughly grounded in the C language > specification > to do so. The compiler does not adhere to our human standard of "logic"; it > follows > the language spec, warts and all. > > -Ben