From 26b55feea8a43829f00d53bb6f3e95b18644eeea Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 10 Sep 2021 23:11:29 -0400 Subject: Avoid GCC recommending a const main These warnings are useful in general, but are pointless with main functions and annoying to avoid. Arbitrarily print something to make it go away. --- test/strerror_test.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/strerror_test.c') diff --git a/test/strerror_test.c b/test/strerror_test.c index b5fd10f..0144852 100644 --- a/test/strerror_test.c +++ b/test/strerror_test.c @@ -7,10 +7,11 @@ #include "zix/common.h" #include +#include #include -static void -test_strerror(void) +int +main(void) { const char* msg = zix_strerror(ZIX_STATUS_SUCCESS); assert(!strcmp(msg, "Success")); @@ -25,12 +26,7 @@ test_strerror(void) msg = zix_strerror((ZixStatus)1000000); assert(!strcmp(msg, "Unknown error")); -} -ZIX_PURE_FUNC -int -main(void) -{ - test_strerror(); + printf("Success\n"); return 0; } -- cgit v1.2.1