diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2017-06-19 14:23:43 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2017-06-19 17:07:35 +0200 |
commit | 1cab7c326b751b3a26c49950c7b85a23ba901001 (patch) | |
tree | 834b201212abdb86f04f7850879778490158bbfd /core/kernel | |
parent | 40b1b281a6f85f8658be749dc92b57d6a8bd5e78 (diff) |
core: ubsan: fix __ubsan_handle_nonnull_arg()
Fixes error:
core/kernel/ubsan.c:114:6: error: conflicting types for built-in function '__ubsan_handle_nonnull_arg' [-Werror]
void __ubsan_handle_nonnull_arg(struct nonnull_arg_data *data, size_t arg_no);
^~~~~~~~~~~~~~~~~~~~~~~~~~
core/kernel/ubsan.c:229:6: error: conflicting types for built-in function '__ubsan_handle_nonnull_arg' [-Werror]
void __ubsan_handle_nonnull_arg(struct nonnull_arg_data *data,
^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
When compiling with gcc 6.2.1
For the record: with GCC 6.0.0 __ubsan_handle_nonnull_arg() was changed to
take only one argument.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/kernel')
-rw-r--r-- | core/kernel/ubsan.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/core/kernel/ubsan.c b/core/kernel/ubsan.c index 53a920b1..507f6f07 100644 --- a/core/kernel/ubsan.c +++ b/core/kernel/ubsan.c @@ -25,10 +25,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <types_ext.h> +#include <compiler.h> #include <kernel/panic.h> -#include <trace.h> #include <string.h> +#include <trace.h> +#include <types_ext.h> struct source_location { const char *file_name; @@ -111,7 +112,11 @@ void __ubsan_handle_vla_bound_not_positive(struct vla_bound_data *data, unsigned long bound); void __ubsan_handle_load_invalid_value(struct invalid_value_data *data, unsigned long val); -void __ubsan_handle_nonnull_arg(struct nonnull_arg_data *data, size_t arg_no); +void __ubsan_handle_nonnull_arg(struct nonnull_arg_data *data +#if __GCC_VERSION < 60000 + , size_t arg_no +#endif + ); static void print_loc(const char *func, struct source_location *loc) { @@ -226,8 +231,11 @@ void __ubsan_handle_load_invalid_value(struct invalid_value_data *data, panic(); } -void __ubsan_handle_nonnull_arg(struct nonnull_arg_data *data, - size_t arg_no __unused) +void __ubsan_handle_nonnull_arg(struct nonnull_arg_data *data +#if __GCC_VERSION < 60000 + , size_t arg_no __unused +#endif + ) { print_loc(__func__, &data->loc); if (ubsan_panic) |