lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 31 Oct 2022 14:07:45 +0100
From:   "Jason A. Donenfeld" <>
To:     "Jiri Slaby (SUSE)" <>
Cc:, Martin Liska <>,
        "David S. Miller" <>,
        Eric Dumazet <>,
        Jakub Kicinski <>,
        Paolo Abeni <>,,
Subject: Re: [PATCH] wireguard (gcc13): cast enum limits members to int in

Hi Jiri,

On Mon, Oct 31, 2022 at 12:44:24PM +0100, Jiri Slaby (SUSE) wrote:
> Since gcc13, each member of an enum has the same type as the enum [1]. And
> that is inherited from its members. Provided "REKEY_AFTER_MESSAGES = 1ULL
> << 60", the named type is unsigned long.
> This generates warnings with gcc-13:
>   error: format '%d' expects argument of type 'int', but argument 6 has type 'long unsigned int'
> Cast the enum members to int when printing them.
> Alternatively, we can cast it to ulong (to silence gcc < 12) and use %lu.
> Alternatively, we can move REKEY_AFTER_MESSAGES away from the enum.
> [1]

Huh, interesting situation. It's interesting that 1<<60 even works at
all on old gccs. I guess that in this case, it just takes the type of
the actual constant, rather than of the enum type?

Either way, I'll apply (a version of) your patch and push it back out on
the next wireguard fixup series.

Thanks for this.


Powered by blists - more mailing lists