2021-10-08 00:14:43

by Nick Terrell

[permalink] [raw]
Subject: Re: [RFC PATCH linux-next] lib: zstd: fix duplicated inclusion



> On Oct 7, 2021, at 4:27 PM, kernel test robot <[email protected]> wrote:
>
> Generated by: scripts/checkincludes.pl
>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>
> ---
> debug.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/lib/zstd/common/debug.h b/lib/zstd/common/debug.h
> index 6dd88d1fbd02c..c8dc0b1890369 100644
> --- a/lib/zstd/common/debug.h
> +++ b/lib/zstd/common/debug.h
> @@ -65,7 +65,6 @@
>
> #if (DEBUGLEVEL>=1)
> # define ZSTD_DEPS_NEED_ASSERT
> -# include "zstd_deps.h"
> #else
> # ifndef assert /* assert may be already defined, due to prior #include <assert.h> */
> # define assert(condition) ((void)0) /* disable assert (default) */

This is an intentional design choice of upstream zstd, and is correct.

Defining ZSTD_DEPS_NEED_ASSERT will cause “zstd_deps.h” to
provide a definition of assert(), even if it has already been included.

-Nick