From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 6C3DAA0C40;
	Fri, 11 Jun 2021 20:16:25 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id DEDD84067C;
	Fri, 11 Jun 2021 20:16:24 +0200 (CEST)
Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com
 [209.85.210.41]) by mails.dpdk.org (Postfix) with ESMTP id 3C8534014F
 for <dev@dpdk.org>; Fri, 11 Jun 2021 20:16:24 +0200 (CEST)
Received: by mail-ot1-f41.google.com with SMTP id
 36-20020a9d0ba70000b02902e0a0a8fe36so3991465oth.8
 for <dev@dpdk.org>; Fri, 11 Jun 2021 11:16:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=h0UGwErhBF45I41GXTkdxB/M51g0QlE27VaNCYKG4Ek=;
 b=gjymA6jeXlIuNbATwMp2BkrH336qhDkGyCJG3ihMnrFVI5RyVor42JFTyXHR2dryvO
 91ynMJ+IAjJA1EXCxFYdk5KIFBxHfsYOuldkjM6L7kzI8YV2i9hfgJwWKqoXwtxiceAh
 kj9laiWFbLinA6LzGqXb+iGAtLrjPPrkHm/EQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=h0UGwErhBF45I41GXTkdxB/M51g0QlE27VaNCYKG4Ek=;
 b=DUF7WrX/NIxLVQ9XmzGfoK8OH30Q0msfR6cHVpGKvoYFNenr8Sx2IsCaJzJ6eGRdez
 zabGd5QagzBSEDD1DLR90T98VceY8lKv7aYWsYhOK3xTwoIXLsPfqQckemMUonnvJvMo
 IHaMrKrrtZqWF/CMWCFCSNlnMDmzcxuHliJDC4QnaB1/nG50xmoBA7EdvcqJ31X6sU9l
 PZkBPR4sjg6e/Ovb5LfRC8X1SyotPAY3OXfxOA3lJlkC/dpRZfBzZAEIMXRFHdODZIB6
 KkUEmwwacJqF2XyHMvsWgBmhvMdkKd2f8aDIM2xM8uBRGeVB7ZszzLXZuLhYbYbdPAGb
 xzIg==
X-Gm-Message-State: AOAM530bXW97MACfLjDzFSoYgWQqNlLYGXmCwHVn/bqByP1zm5W2ZIlf
 Ifz4S5/n8TL8tiXHKnJvaoCoO4todi+/LTdhaL4oXQ==
X-Google-Smtp-Source: ABdhPJw6LTFFTg7Vy9rzHNN5iljnuK23Z6/rMLc/BrWeZND3+qD9DfC5Jfe9UXMVIfel6DV9UuJyCdf/69Cm/2oVo8w=
X-Received: by 2002:a9d:4b98:: with SMTP id k24mr4259169otf.359.1623435383484; 
 Fri, 11 Jun 2021 11:16:23 -0700 (PDT)
MIME-Version: 1.0
References: <CAHx6DYC32D9FTsCXpRbShgCcKTwMB9GOp0HZBBcUBc8NjZ7y5A@mail.gmail.com>
 <20210610143604.48278bcc@hermes.local> <f7teed8zczx.fsf@redhat.com>
In-Reply-To: <f7teed8zczx.fsf@redhat.com>
From: Owen Hilyard <ohilyard@iol.unh.edu>
Date: Fri, 11 Jun 2021 14:15:47 -0400
Message-ID: <CAHx6DYC8gx+3u7Sbt9LgkgM5U0-_+uaeKvpUUw8ZAn5juOrCug@mail.gmail.com>
To: Aaron Conole <aconole@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
 David Marchand <david.marchand@redhat.com>, 
 dev <dev@dpdk.org>, Rasesh Mody <rmody@marvell.com>,
 Shahed Shaikh <shshaikh@marvell.com>
Content-Type: text/plain; charset="UTF-8"
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
Subject: Re: [dpdk-dev] Define statement with UB prevents compilation using
 UBSAN
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Seeing the discussion so far, do we want to change the single definition to
be (0b1u << 31) so it works, or should we make this change in a wider scope
(file, directory, project-wide). If we do make the change in a wider scope,
should we only change instances where there is UB (1 << 31) or should we
change all of the bitflags and similar constructs to uint32_t? If we change
a lot, it may require special testing since I don't think every driver is
tested on a regular basis, and making a change like this in a wide-reaching
fashion has the potential to break a lot of things.

On Fri, Jun 11, 2021 at 10:34 AM Aaron Conole <aconole@redhat.com> wrote:

> Stephen Hemminger <stephen@networkplumber.org> writes:
>
> > On Thu, 10 Jun 2021 16:51:37 -0400
> > Owen Hilyard <ohilyard@iol.unh.edu> wrote:
> >
> >> Working backward to the define
> >> statement, AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY is defined as
> >>
> >> #define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY (0x1 << 31)
> >
> > Why not (1u << 31)?
>
> +1
>
> CC'd the QLogic maintainers as well.
>
>