From ec8f61e98e7e644c0610defd46fcba184f896e2b Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Thu, 19 Dec 2019 15:49:36 +0200 Subject: tests: fix undefined behaviour. When aggressive optimizations are enabled, compiler hits undefined behaviour during loop unrolling. Fix this to allow safely unrolling the offending loop. Signed-off-by: Gediminas Jakutis --- test/diagnostic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/diagnostic.c') diff --git a/test/diagnostic.c b/test/diagnostic.c index 56a8a65..866f9f2 100644 --- a/test/diagnostic.c +++ b/test/diagnostic.c @@ -126,7 +126,7 @@ static int format_test(void) static const char *expected_warn[] = {"warning:format_test:\n", "", "warning:format_test:%08lx:message is 3\n", "warningwarningwarningwarning"}; static const char *expected_fixme[] = {"fixme:format_test:\n", "", "fixme:format_test:%08lx:message is 3\n", "fixmefixmefixmefixme"}; static const char *expected_info[] = {"info:format_test:\n", "", "info:format_test:%08lx:message is 3\n", "infoinfoinfoinfo"}; - static const char *msg[] = {"", "", "message is %zu"}; + static const char *msg[] = {"", "", "message is %zu", ""}; /* `ninja test` seems to be intercepting stdout, so we cannot test the default outstream */ -- cgit v1.2.3