From e6bbd14a934c572793afdd434f6e514fb33471d3 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 27 Jul 2017 19:04:18 +0200 Subject: call: Fix structure mismatch GCC with LTO enabled warn: /bin/sh ../libtool --tag=CC --mode=link gcc -O2 -Wall -flto -o call call.o menu.o crc.o yapp.o dostime.o -lncursesw -lax25 libtool: link: gcc -O2 -Wall -flto -o call call.o menu.o crc.o yapp.o dostime.o -lncursesw -lax25 menu.h:22:9: warning: type of 'winopen' does not match original declaration [-Wlto-type-mismatch] WINDOW* winopen(wint*, int, int, int, int, int); ^ menu.c:20:9: note: 'winopen' was previously declared here WINDOW *winopen(wint * wtab, int nlines, int ncols, int begin_y, ^ menu.c:20:9: note: code may be misoptimized unless -fno-strict-aliasing is used This was caused by different .c files being built with different libc feature selection macros. Adding #define _DEFAULT_SOURCE #define _XOPEN_SOURCE #define _XOPEN_SOURCE_EXTENDED to menu.c would have been sufficient but it seems good practice to add the same definition to all .c files. Signed-off-by: Ralf Baechle --- call/crc.c | 3 +++ call/dostime.c | 4 ++++ call/menu.c | 3 +++ call/yapp.c | 3 +++ 4 files changed, 13 insertions(+) diff --git a/call/crc.c b/call/crc.c index ba17f1c..d3484a0 100644 --- a/call/crc.c +++ b/call/crc.c @@ -6,6 +6,9 @@ created: Mark Wahl DL4YBG 94/01/17 updated: Mark Wahl DL4YBG 94/01/17 */ +#define _DEFAULT_SOURCE +#define _XOPEN_SOURCE +#define _XOPEN_SOURCE_EXTENDED #include "crc.h" diff --git a/call/dostime.c b/call/dostime.c index 910a66e..cb701a7 100644 --- a/call/dostime.c +++ b/call/dostime.c @@ -1,3 +1,7 @@ +#define _DEFAULT_SOURCE +#define _XOPEN_SOURCE +#define _XOPEN_SOURCE_EXTENDED + #include #include #include diff --git a/call/menu.c b/call/menu.c index 7de66b4..05ea00b 100644 --- a/call/menu.c +++ b/call/menu.c @@ -5,6 +5,9 @@ * 22.07.1995 wininfo->wint (vector->single chain) Alexander Tietzel (DG6XA) * 25.07.1995 some minor changes Alexander Tietzel (DG6XA) */ +#define _DEFAULT_SOURCE +#define _XOPEN_SOURCE +#define _XOPEN_SOURCE_EXTENDED #include #include diff --git a/call/yapp.c b/call/yapp.c index cc61e90..355701f 100644 --- a/call/yapp.c +++ b/call/yapp.c @@ -11,6 +11,9 @@ * as published by the Free Software Foundation; either version * 2 of the license, or (at your option) any later version. */ +#define _DEFAULT_SOURCE +#define _XOPEN_SOURCE +#define _XOPEN_SOURCE_EXTENDED /* * Yapp C and Resume support added by S N Henson. -- cgit v1.2.3