Re: [PATCH 1/2] lib: workaround the 'redeclared with different type' errors

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

 



On Wed, Jul 19, 2017 at 4:05 PM, Ramsay Jones
<ramsay@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> The 'selfcheck' make target issues sparse errors for function symbols
> 'error_die' and 'die', like so:
>
>        CHECK    lib.c
>   lib.c:194:6: error: symbol 'error_die' redeclared with different type \
>         (originally declared at lib.h:98) - different modifiers
>   lib.c:203:6: error: symbol 'die' redeclared with different type \
>         (originally declared at lib.h:94) - different modifiers
>
> This is caused by the 'noreturn' attribute being treated similar to a
> type qualifier and insisting that, not only the declaration and the
> definition of the function have the 'noreturn', but that they have the
> attribute in the same position.
>
> In order to suppress the error, move the attribute(s) to the beginning
> of the declaration, in the header file, and add an 'noreturn' attribute
> at the beginning of the definition (in lib.c).
>
> Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxxx>

Applied to sparse-next.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux