X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com Message-ID: <57152494.6040808@gmx.de> Date: Mon, 18 Apr 2016 20:16:52 +0200 From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via djgpp-workers AT delorie DOT com]" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7 MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: Test build of gcc-6.0.1-20160415 References: <5713789D DOT 8070708 AT iki DOT fi> In-Reply-To: <5713789D.8070708@iki.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:jz7EOGew+6E6tCIsnyGT5XSnf/W9orHj7P11EGcq/i/JWIfXkP9 vHgDe4XPVMYMqADCcAcjLm8Lzxz6sNR50ibrSndijwIEtxHwxKLGHd6lqko55pzSg+nsu+3 ZSwMKapZjIBOmrHE4HfzKYR5qB8XZhEhFUl9FPoxGn48J+tTBkjP9zprXgavGrS7AfnBR1/ Mcg//A+S9OCz+Q+YMYKrw== X-UI-Out-Filterresults: notjunk:1;V01:K0:oDw/i2FfIl0=:mM/znSBGeOqUIqksgM7eEy EPafSw6n/3tDnfm37W+m74WjIrCO9K2KWcIHf/pBre74u8IRnpjVr4hK85xuYjHkZF5T3Ogog /pJLNUUDKq/14VcEQhqXP2JHjaIBzFoTqpsDjoUTqmT3mT/iDztnez87Ir/QNnHyH/kQJTcZr QFeCRf3Yc4CfW9yHg8QvZlCFFnKIi5/0RbdkUNCpMVyzLViDidjYSe2tYTg6Qdi06Xb7w1Uqc 2VJjoMt9nfZ1kSxIbPxkobqBfMk77Of0oCSzyttDA0NYKgi0X7b8jUg1Hlne+q2LpTlE90QIj muNhd0ZXaCkPobqxPdTJRaedt6tQqXvKioVjBKJkFhalku61nrPIgclInZTj8f2WaL7DDfh8h h9rsETYTl8Cr+mmgb2tQEpeTEd4XY+e5nTtCU/tFWLEap3QMbJ04REkj3JXdSIK30Sw9xRIcD 79lpmzVo13rOTF3MxhKbX+y8Ofrmh17Dyil04jfisyFb7pUUiU0Gp8RW/7/EpgonuCpMc8QOg MxNOWn/eSbzJrpmQlYrWraq332/ywwZhFKsTz//ViPKXS94ZLwwp2I++XaeCB9syiJM+yyY1I /RuDszO0as12px0taoZ852YmvpkSyiTPAhXRutK5wPYq2sVNDMUqKMxeS/cHQiNQ7lTOjj7UM rPthGRkxKHO6A5egyPTHbJm6CEDQ/SZRd5CEdguIuXIg3FhUcfeRfFzzDauveDJKAJFXj5wUd HTK2rR59eOFfqTlMNjlrILu9kfNjQWilHLE+Itn4Hh0WN5RoorgCyPf8c9b681e834T5khgDA rY8D3Ki Reply-To: djgpp-workers AT delorie DOT com Am 17.04.2016 13:50, schrieb Andris Pavenis (andris DOT pavenis AT iki DOT fi) [via djgpp-workers AT delorie DOT com]: > gcc-6.1.0 should not be very far any more: > > https://gcc.gnu.org/ml/gcc/2016-04/msg00103.html > https://gcc.gnu.org/ml/gcc/2016-04/msg00109.html > > I built DJGPP port based on SVN revision r235040 (the same used for release candidate sources) checked out from git mirror (see https://gcc.gnu.org/wiki/GitMirror for details). Of course DJGPP related additional changes are merged. > > Files (both i686 and x86_64 rpms and native DJGPP build are available for testing at: > > http://ap1.pp.fi/djgpp/gcc/test/6.0.1-20160415/ > > Andris > I have tried to build libc from repository using g[cc|pp]601_20160415b.zip. It fails with the following error message: gcc ... -c strlen.c strlen.c: In function 'strlen': strlen.c:10:6: error: nonnull argument 'str' compared to NULL [-Werror=nonnull-compare] if (str == NULL) ^ cc1.exe: all warnings being treated as errors ../../../makefile.inc:89: recipe for target 'strlen.o' failed make.exe[3]: *** [strlen.o] Error 1 makefile.sub:2: recipe for target 'all_subs' failed make.exe[2]: *** [all_subs] Error 2 ../makefile.lib:6: recipe for target 'all' failed make.exe[1]: *** [all] Error 2 makefile:39: recipe for target 'subs' failed make.exe: *** [subs] Error 2 Inspecting the strlen code, it is clear that the offending code segment is: if (str == NULL) return 0; It seems to be that for some reason, the compiler does assume that the passed argument to the function can never be NULL. If I understood correctly, this should only be the case if the function is specified like this: size_t strlen(const char *_s) __attribute__ ((__nonnull__ (1))); specifying that _s is never NULL, but this is certainly not the case in the current versions of string.h. So the question arises if we have to remove all NULL pointer check from our code and if this measure is really wise? IMHO, we should adjust the compiler checks in such a way that NULL pointer checks are still possible. BTW I have inspected http://pubs.opengroup.org/onlinepubs/009695399/functions/strlen.html and I have seen no indication that a NULL pointer check is prohibited, but also I have seen no indication that a NULL pointer check is allowed. Regards, Juan M. Guerrero