[dpdk-dev] Define statement with UB prevents compilation using UBSAN

Owen Hilyard ohilyard at iol.unh.edu
Fri Jun 11 20:15:47 CEST 2021


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 at redhat.com> wrote:

> Stephen Hemminger <stephen at networkplumber.org> writes:
>
> > On Thu, 10 Jun 2021 16:51:37 -0400
> > Owen Hilyard <ohilyard at 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.
>
>


More information about the dev mailing list