]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings
authorAndrey Ryabinin <aryabinin@virtuozzo.com>
Mon, 6 May 2019 10:45:26 +0000 (13:45 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 2 Jul 2019 10:07:53 +0000 (12:07 +0200)
commit0c428ffb8b8da591c3a4d1e3fbc33f5e6d68b641
tree131306d7288c3afa43c9c5b803689389230a8a84
parentc2ec2675b45d2794f1053ab37a96b7f8cc172d64
ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings

BugLink: https://bugs.launchpad.net/bugs/1834529
commit f0996bc2978e02d2ea898101462b960f6119b18f upstream.

Building lib/ubsan.c with gcc-9 results in a ton of nasty warnings like
this one:

    lib/ubsan.c warning: conflicting types for built-in function
         ‘__ubsan_handle_negate_overflow’; expected ‘void(void *, void *)’ [-Wbuiltin-declaration-mismatch]

The kernel's declarations of __ubsan_handle_*() often uses 'unsigned
long' types in parameters while GCC these parameters as 'void *' types,
hence the mismatch.

Fix this by using 'void *' to match GCC's declarations.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Fixes: c6d308534aef ("UBSAN: run-time undefined behavior sanity checker")
Cc: <stable@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
lib/ubsan.c