From owner-svn-src-all@freebsd.org Fri Apr 14 16:21:19 2017 Return-Path: Delivered-To: svn-src-all@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 3C437D3DF53; Fri, 14 Apr 2017 16:21:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (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 CF3F6AE1; Fri, 14 Apr 2017 16:21:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f51.google.com with SMTP id o81so132887970wmb.1; Fri, 14 Apr 2017 09:21:18 -0700 (PDT) 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:content-transfer-encoding; bh=MuF1fL4wP1zl7aYEqmI8Old8lhHcMrsWjX5dgV/Tm8o=; b=Pn5yft7JzApttt5k5KT6suBsVGaSdWS/zFF4zgTiW7hl1ryR0HyT7sAtS8Y1Q33/XS DxTP1CTY1wDaMjdIewdSxEUyOM5bSeWsb0kQyoxxWjp+2trgNlvD8TWgUFgER8WnNnLf umHF4cJUFSLIziomMpwSNvSrzf3PKtWaQHiPlQHXAs3mPz3xF8ypvw/2zy7lpXO66KFL 4avPhnushUzj83eYfb7J8al4NK7m3p/bH5LXOBvpkmKOzVaGExbckD6lT8M86BY843UB AmPNc1klAMoZkahgGMSrIC1XJo14tPR/J73e9U8DkvzppX34Dj8xCX2D05YjE3qckBeJ 7f4Q== X-Gm-Message-State: AN3rC/6Dgcfs0A6d3az6JD6p7fVw/r6XKF/ATYLH6MqvzPxEy+lBC66d nO0HU527G0EwWg== X-Received: by 10.28.133.139 with SMTP id h133mr30643769wmd.87.1492186535977; Fri, 14 Apr 2017 09:15:35 -0700 (PDT) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com. [74.125.82.50]) by smtp.gmail.com with ESMTPSA id v7sm2916446wrd.0.2017.04.14.09.15.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 09:15:35 -0700 (PDT) Received: by mail-wm0-f50.google.com with SMTP id u2so67538663wmu.0; Fri, 14 Apr 2017 09:15:35 -0700 (PDT) X-Received: by 10.28.218.197 with SMTP id r188mr8272286wmg.0.1492186535731; Fri, 14 Apr 2017 09:15:35 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Fri, 14 Apr 2017 09:15:35 -0700 (PDT) In-Reply-To: <1492185206.73883.126.camel@freebsd.org> References: <201704141158.v3EBwfLm003147@repo.freebsd.org> <1492185206.73883.126.camel@freebsd.org> From: Conrad Meyer Date: Fri, 14 Apr 2017 09:15:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316826 - head/sys/netpfil/ipfw/nat64 To: Ian Lepore Cc: "Andrey V. Elsukov" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 14 Apr 2017 16:21:19 -0000 Ian, I don't know about "guaranteed," but it certainly looks like the htonl/bswap macros intend to avoid double-evaluating macro parameters. On Fri, Apr 14, 2017 at 8:53 AM, Ian Lepore wrote: > On Fri, 2017-04-14 at 08:32 -0700, Conrad Meyer wrote: >> On Fri, Apr 14, 2017 at 4:58 AM, Andrey V. Elsukov >> wrote: >> > >> > Author: ae >> > Date: Fri Apr 14 11:58:41 2017 >> > New Revision: 316826 >> > URL: https://svnweb.freebsd.org/changeset/base/316826 >> > >> > Log: >> > Avoid undefined behavior. >> > >> > The 'pktid' variable is modified while being used twice between >> > sequence points, probably due to htonl() is macro. >> FYI =E2=80=94 there are a ton of similar reports in sys/rpc due to the X= DR >> macros (which read a network value off a pointer and increment it). >> See e.g., IXDR_GET_UINT32() macro. >> >> Best, >> Conrad > > Aren't they all false positives, since the macros involved are g'teed > not to evaluate their arguments more than once as written (because > __builtin_constant_p always evaluates at compile time)? Do we really > want to churn our source code to eliminate false positives from some > tool that appears to still be in its alpha-testing state? > > -- Ian