Mail Archives: djgpp-workers/2016/04/24/13:58:52
On 04/21/2016 06:41 AM, Andris Pavenis (andris DOT pavenis AT iki DOT fi) [via djgpp-workers AT delorie DOT com] wrote:
> On 04/21/2016 01:15 AM, Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via
> djgpp-workers AT delorie DOT com] wrote:
>> Am 18.04.2016 23:12, schrieb Andris Pavenis (andris DOT pavenis AT iki DOT fi) [via
>> djgpp-workers AT delorie DOT com]:
>>> On
>>
>> The patch below is a proposition how the -Werror=nonnull-compare issue could be
>> handled. The patch has intentionaly not been committed because there may be
>> multiple ways to fix this issue. I have intentionaly prefered the way using
>> all the different -fno-builtin-* flags. This way we see about what we are
>> warned and what we are intentionaly ignoring. I have no preferences and if
>> someone else disigns a smarter or different fix, feel free to discard this
>> approach.
>>
>>
>> Regards,
>> Juan M. Guerrero
>>
>>
>>
>> 2016-04-20 Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
>>
>> * djgpp/src/makefile.cfg: Fixing -Werror=nonnull-compare for gcc 6.0.1.
>>
>>
>>
> - I guess it would be better to avoid using -fno-builtin-* globally, but only where required
>
> - there seems to be no need to protect for old GCC versions as documented behavior of gcc is to
> ignore
> -fno-builtin-foobar when it does not have __builtin_foobar. Tried under Linux (both gcc-5.3 and
> 3.4.6 provided with Fedora 23 behave this way).
>
> - one could use simple -fno-builtin for small source files like strlen.c where there is actually
> one built involved (easier to maintain in future
Tried variant with --fno-builtin-*
- gcc-6.0.1-20160415 (cross-compiling from Linux)
- gcc-3.4.6 (in WIndows 10 Home 32 bit VM under Linux)
No additional problems detected (except that gcc-l.opt, gcc.opt and gcc.opt were included in DJGPP
source archive and as result gcc-3.4.6 complained about use of -iquote. Fixed that in trunk.
Andris
Index: src/libc/ansi/string/makefile
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/ansi/string/makefile,v
retrieving revision 1.1
diff -p -r1.1 makefile
*** src/libc/ansi/string/makefile 16 Jun 1995 08:03:22 -0000 1.1
--- src/libc/ansi/string/makefile 24 Apr 2016 16:45:00 -0000
*************** SRC += syserr2.c
*** 28,30 ****
--- 28,32 ----
SRC += syserr3.c
include $(TOP)/../makefile.inc
+
+ strlen.o: EXTRA_CFLAGS += -fno-builtin-strlen
Index: src/libc/c99/math/makefile
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/c99/math/makefile,v
retrieving revision 1.7
diff -p -r1.7 makefile
*** src/libc/c99/math/makefile 20 Oct 2013 13:57:11 -0000 1.7
--- src/libc/c99/math/makefile 24 Apr 2016 16:45:00 -0000
*************** fp-asm.h: fp-asm.sed $(TOP)/../../includ
*** 36,38 ****
--- 36,42 ----
clean::
$(MISC) rm fp-asm.h
+
+ nan.o: EXTRA_CFLAGS += -fno-builtin-nan
+ nanf.o: EXTRA_CFLAGS += -fno-builtin-nanf
+ nanl.o: EXTRA_CFLAGS += -fno-builtin-nanl
Index: src/libc/compat/string/makefile
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/compat/string/makefile,v
retrieving revision 1.7
diff -p -r1.7 makefile
*** src/libc/compat/string/makefile 19 Jan 2003 13:03:56 -0000 1.7
--- src/libc/compat/string/makefile 24 Apr 2016 16:45:00 -0000
*************** SRC += strsep.c
*** 22,24 ****
--- 22,28 ----
SRC += strupr.c
include $(TOP)/../makefile.inc
+
+ stpcpy.o: EXTRA_CFLAGS += -fno-builtin-stpcpy
+ stpncpy.o: EXTRA_CFLAGS += -fno-builtin-stpncpy
+ strdup.o: EXTRA_CFLAGS += -fno-builtin-strdup
Index: src/libc/posix/string/makefile
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/string/makefile,v
retrieving revision 1.3
diff -p -r1.3 makefile
*** src/libc/posix/string/makefile 14 Nov 2013 20:00:17 -0000 1.3
--- src/libc/posix/string/makefile 24 Apr 2016 16:45:00 -0000
*************** SRC += strndup.c
*** 8,10 ****
--- 8,13 ----
SRC += strnlen.c
include $(TOP)/../makefile.inc
+
+ strndup.o: EXTRA_CFLAGS += -fno-builtin-strndup
+
- Raw text -