From owner-freebsd-arm@freebsd.org Sun Sep 16 21:18:23 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 970CE1080C43 for ; Sun, 16 Sep 2018 21:18:23 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-22.consmr.mail.gq1.yahoo.com (sonic311-22.consmr.mail.gq1.yahoo.com [98.137.65.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44123819C9 for ; Sun, 16 Sep 2018 21:18:23 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: aBOTvt4VM1lOU_VaJz55xDv4BQPkvbWowWnPwNVfyFWcl.b2e7TsLQmfDxoK6MB XXiclXZIosmO9XDy5O0kG5m5lv3d9Dl9ihbLgmWddNz85HMT2PCC.OL_B8nHoOYlfRmFt4uJUSWI _rTMGsZAPlJT0qqe21uIOhH5Qp4Rsxv3yvDzFEgS51BQOIE3zO17N_IWp0ceUn6jo7ho55Kmb3pa Q.QMevQEE8Zumsqs7Id5KK4Hd_BBdLz963FUozagwESR.D33aiSOrw16AAIHlgmu6eLJVwgZJoOh JoaJDEG7.rACViSrh8UIyWAt2h8aFLGqzphiq5YXfTEbDKvlZAqEyjModv4gMUGtyZi_MVblI5zP M.d9k.8qUvz9Mk0nKsIbumgPzTKzAF4tztvdmrU.ngH3BcxQx2yWaFrakjVJdzvD8lGX6EClH_ed V5Cd6zKHzetdbt6MswYOcRyI0Vz6t.wMakXwDLPr1VWSb7wkOfgHgaL8dtCan23Dx24vTiED03zo TkQWWUDEdpCBJriO7EELPrPPuMTiPnXJMgdKly_dXaq59n4_RuSM2edZFZluUv49FIiKvqF61nZk IlWB21Bmvbco.d0q.8SMNGMihU5h.eUklAr79kP0nNXOOfJ33A6srmrtrV1ptMyDH2pmAffBx0ls wQgSRx4Ya8xqujKdgTdBBt4T7VzOQOEX158kxKFydYRdTtXAzZXh5KS2Vmnp4NbghGppQwmloSfL 2nJImixxO2T9Zu8pu9GAesewhnWiEXiFQQBx573fRtj2.q.f7Vp_WZYm93mIjryDlAglBruSfIZr uvLry6KV7xSxTWYrTXjZvwhXHNVxqN9iPsfkl4kZy4orgCvqjTABUNIw.q.xtIva0lUz.9QtufC_ A4XZO5b0MJ2mbqmuf17p2xuZpPI17mq8vrHgsNHNB747OF8oK4Yl25MfmBfyR8yBtGPeczPhjqBf TibBDZBlbVnIiNlOWA2SbgtXq4H95NS3om56UXE.DWRjwViA2CEUxxcQPwlbj0KIzkf5rw5BMbJ8 5PIWdXFR2 Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.gq1.yahoo.com with HTTP; Sun, 16 Sep 2018 21:18:21 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp420.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID eb64288a0ca7d1d2582ace146573d790; Sun, 16 Sep 2018 20:58:05 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: FYI: devel/kyua 14 failures for head -r338518M based build in a Pine64+ 2GB (aarch64 / cortexA53 / A64) context From: Mark Millard In-Reply-To: <20180916205029.GB55717@stack.nl> Date: Sun, 16 Sep 2018 13:58:04 -0700 Cc: freebsd-arm , FreeBSD Current Content-Transfer-Encoding: 7bit Message-Id: <8FD86880-11E4-49E3-848E-B05FF23A37B5@yahoo.com> References: <20180916175029.GA55717@stack.nl> <20180916205029.GB55717@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2018 21:18:23 -0000 On 2018-Sep-16, at 1:50 PM, Jilles Tjoelker wrote: > On Sun, Sep 16, 2018 at 01:21:33PM -0700, Mark Millard wrote: >> On 2018-Sep-16, at 10:50 AM, Jilles Tjoelker wrote: > >>> On another note, the comment just below that, > >>> /* But we need to zero-extend (char is unsigned) the value and then >>> perform a signed 32-bit subtraction. */ > >>> shows a wrong reason for doing the right thing since memcmp (as well as >>> strcmp and strncmp) are defined to compare based on unsigned chars, >>> regardless of the signedness of char. > >> Ahh, standard are so much fun: there are so many to choose from. > >> I looked up ISO/IEC 9899:2011 (E) and its 7.24.4.1 "The memcmp function". >> It makes no such explicit claim about using using unsigned chars for >> the comparison standard: > >> QUOTE of the Description part: >> The memcmp function compares the first n characters of the object pointed >> by s1 to the first n characters of the object pointed by s2. >> END QUOTE > >> QUOTE of the Returns part: >> The memcmp function returns an integer greater than, equal to, or less >> than zero, accordingly as the object pointed to by s1 is greater than, >> equal to, or less than the object pointed to by s2. >> END QUOTE > >> If I had to guess the intent of "characters" would be based on the >> char type for C11. I did not find anything about the issue in the C99 >> rationale that I also happen to have available to look at. > > In C99, C11 and C17, the text about using unsigned chars is under > "Comparison functions" and it applies to memcmp, strcmp and strncmp > (which are documented together in the section). > >> For all I know, POSIX or other standards may be more explicit and not >> agree. > > POSIX does not document memcmp, strcmp and strncmp close together and > copies the text about using unsigned chars to each of them. This means > that it agrees with the C standards. > Thanks for noting the factored-out material in the C11 standard. Sorry for the noise of missing that factorization when I looked up memcmp. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)