]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit644c6956561afff45958c5febb2be951e8deb600
tree0382b989f6d763dc3986ff0a7706c66fd2dc19d5
parent0dde42f556bc1a77e73a058d993ec5cb5f8feb1b
ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings

BugLink: https://bugs.launchpad.net/bugs/1838459
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: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
lib/ubsan.c