Re: [PATCH] fix multiple definition linking error due to missing extern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 6, 2022 at 12:59 PM Dirk Müller <dmueller@xxxxxxx> wrote:
>
> GCC 10+ defaults to -fno-common, which enforces proper declaration of
> external references using "extern". without this change a link would
> fail with:
>
>   lib/raid6/test/algos.c:28: multiple definition of `raid6_call';
>   lib/raid6/test/test.c:22: first defined here
>
> Signed-off-by: Dirk Müller <dmueller@xxxxxxx>
> ---
>  lib/raid6/test/test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/raid6/test/test.c b/lib/raid6/test/test.c
> index a3cf071941ab..ab0459150a61 100644
> --- a/lib/raid6/test/test.c
> +++ b/lib/raid6/test/test.c
> @@ -19,7 +19,7 @@
>  #define NDISKS         16      /* Including P and Q */
>
>  const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
> -struct raid6_calls raid6_call;
> +extern struct raid6_calls raid6_call;

Can we just remove this line?

Thanks,
Song




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux