[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] blake2-impl.h: use the C99's inline keyword
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] blake2-impl.h: use the C99's inline keyword |
Date: |
Mon, 19 Feb 2024 14:32:53 +0000 |
User-agent: |
Mozilla Thunderbird |
On 13/02/2024 07:36, nightquick wrote:
Note: I'm aware that there's a GitHub repository (upstream) but it doesn't seem
like the repository is practically active anymore. There's libb2 which also
implements blake2 (with C99 inline), but it's a little different than the
current one. The implementation in libb2 removes *16 (e.g. load16) functions.
Apparently, this patch also "fixes" (or adds) inlining, when the compiler is
LLVM (Clang). (Previously there was __GNUC__ and without __clang__, inline will only
going to enabled for GCC.
This patch does cleanup the code,
but also diverges from the (albeit dormant) upstream.
Any compiler should inline where appropriate anyway,
so I don't see any practical reason for this change.
BTW clang does identify as __GNUC__ in this regard:
clang -E -dM - < /dev/null | grep GNUC
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__ 4
I it was applied upstream then we'd resync.
thanks,
Pádraig