[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT/NEWLIB PATCH] Add __assert_fail from musl 1.1.19 .
Hey Felipe, Thank you Felipe. I have one comment that may be fixed inline. Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx> On 19.03.2020 21:31, Felipe Huici wrote: Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx> --- Makefile.uk | 1 + musl-imported/src/exit/assert.c | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 musl-imported/src/exit/assert.c diff --git a/Makefile.uk b/Makefile.uk index 8d683d8..82836e4 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -144,6 +144,7 @@ LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/misc/syslog.c LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/termios/tcsetattr.c LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/termios/tcgetattr.c LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/math/sincosl.c +LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/exit/assertifeq ($(CONFIG_LIBNEWLIBC_CRYPT),y)LIBNEWLIBGLUE_CFLAGS-y += -Wno-missing-braces -Wno-sign-compare -Wno-char-subscripts diff --git a/musl-imported/src/exit/assert.c b/musl-imported/src/exit/assert.c new file mode 100644 index 0000000..f897c68 --- /dev/null +++ b/musl-imported/src/exit/assert.c @@ -0,0 +1,9 @@ +#include <stdio.h> +#include <stdlib.h> + +_Noreturn void __assert_fail(const char *expr, const char *file, int line, const char *func) The _Noreturn attribute has been introduced in C11. Also, the code generated by gcc for the _Noreturn trashes the stack frame[1]. I would suggest using __attribute__((noreturn)). (available in both GCC and clang) [1] https://www.openwall.com/lists/musl/2016/08/30/1 +{ + fprintf(stderr, "Assertion failed: %s (%s: %s: %d)\n", expr, file, func, line); + fflush(NULL); + abort(); +} _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |