From patchwork Thu Oct 25 16:13:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Torsten_B=C3=B6gershausen?= X-Patchwork-Id: 10656151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F227917DE for ; Thu, 25 Oct 2018 16:18:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2E0E2BF41 for ; Thu, 25 Oct 2018 16:18:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0CCF2BF47; Thu, 25 Oct 2018 16:18:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9695E2BF41 for ; Thu, 25 Oct 2018 16:18:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727800AbeJZAvm (ORCPT ); Thu, 25 Oct 2018 20:51:42 -0400 Received: from mout.web.de ([217.72.192.78]:54939 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727319AbeJZAvm (ORCPT ); Thu, 25 Oct 2018 20:51:42 -0400 Received: from tor.lan ([195.198.252.176]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M4I6Z-1fOyub1yzL-00rm5B; Thu, 25 Oct 2018 18:13:10 +0200 Received: from tor.lan ([195.198.252.176]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M4I6Z-1fOyub1yzL-00rm5B; Thu, 25 Oct 2018 18:13:10 +0200 From: tboegi@web.de To: git@vger.kernel.org Cc: =?utf-8?q?Torsten_B=C3=B6gershausen?= Subject: [PATCH v1 1/2] path.c: char is not (always) signed Date: Thu, 25 Oct 2018 18:13:08 +0200 Message-Id: <20181025161308.29207-1-tboegi@web.de> X-Mailer: git-send-email 2.19.0.271.gfe8321ec05 MIME-Version: 1.0 X-Provags-ID: V03:K1:63zpcYxzvhHZJotdOMjXAym8HcloIyJdfks/fHWbtYZJTjD28mv 8ZIQg8hSl0QrC/bd/ONbUUbD5YW6unMhCE2E37JZ0ZG3Og3ILJfsGisSJYEU5AM6rai7/nH +RyO9ysX4KKZQreKL1bi8nTQLQz0mOJnhXQlEWJoD4Yr/5K/ZNLwu7Oekf+iC46Gnh7OSts /JnoUetQ+szD7YUFNHGcA== X-UI-Out-Filterresults: notjunk:1;V01:K0:jW58gLvN/+Y=:34j3t9D8tpHXAhTw4o/MyD ZPil0g5SZvpGHnj8Bi8vvFDHM7zjEkw/0J1cCIgkB9/L+AOwPJhJm50qvpRZcKCHizgjO+sEC HDiOGX3Q9lsuOBduBXXeQVT9uU6xeHTwFct0nf1Zva0ZTZ5zCQGZJs9AuKJ0hitd/0B10IhlT Easdpw0AS64tkBVrhEHaKB2Jup4RNru1BGlvsd1qeHjj/zpTpMxxk1PjtS1NBnoprliKcU8zx d9YilcI1nhX4DPbPEsM++/bFeg1whWJoKUCfDE9uIYuMmEXo2zO3QyssLfg3SMRgNERaoM/P7 71Pq0FEG3YFejqyZp1Wbo1+wMvbg3FIURCdVZux57+lNwNhpy8bYd3VbYozfpFXDnlcvxaFVc F+6e2k7wMYFox9OZeAweQao1zo+ky6//FgPG5Ig5jqFhIgTVV4up+EI0bOJi5dvmNq0k367xq WM02YqTrbIGer2scUjS/E+aXLZgillMnFs4i71XZSl7QXB1RogWLP5x/kgUI/VzwOdY86W3E+ YZ9f2VX5Ym0ykfe21z6aSwec/kwJjO91x5O7jIU3teBL3zg61cO/dVzXDIXXFfEXhsl2NeeHy zQG3dFXaFeBvxKy4bbobmycruEzT73JzyMSNcu8SyAfS6uDGPN0biqFO4JMizra78wAAZEmTK qAKF2iGVgAJGFVYBTXEKG1Drtz98iYComLSu4EWDLWpzoV9lf4D9vTuazedFfCWR2qi1E2B+P PsVroqsGUCSLmMzlRUXarjWYFnBFHXej1Re5RRFNUsXIBAKSDQ4drhLk50iIZELgyPeKIjSRL gfNELsOEBFOM9Y36I1XhR/349xRh52EsbBXYHIH3YBB1XRDwmM= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Torsten Bögershausen If a "char" in C is signed or unsigned is not specified, because it is out of tradition "implementation dependent". Therefore constructs like "if (name[i] < 0)" are not portable, use "if (name[i] & 0x80)" instead. Detected by "gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516" when setting DEVELOPER = 1 DEVOPTS = extra-all Signed-off-by: Torsten Bögershausen --- path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path.c b/path.c index 34f0f98349..ba06ec5b2d 100644 --- a/path.c +++ b/path.c @@ -1369,7 +1369,7 @@ static int is_ntfs_dot_generic(const char *name, saw_tilde = 1; } else if (i >= 6) return 0; - else if (name[i] < 0) { + else if (name[i] & 0x80) { /* * We know our needles contain only ASCII, so we clamp * here to make the results of tolower() sane. From patchwork Thu Oct 25 16:13:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Torsten_B=C3=B6gershausen?= X-Patchwork-Id: 10656145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0EB9C14DE for ; Thu, 25 Oct 2018 16:13:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFEEA2BEF5 for ; Thu, 25 Oct 2018 16:13:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E44AC2BF00; Thu, 25 Oct 2018 16:13:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81DFB2BEF5 for ; Thu, 25 Oct 2018 16:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727712AbeJZAqk (ORCPT ); Thu, 25 Oct 2018 20:46:40 -0400 Received: from mout.web.de ([212.227.15.4]:40753 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727313AbeJZAqj (ORCPT ); Thu, 25 Oct 2018 20:46:39 -0400 Received: from tor.lan ([195.198.252.176]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LmLac-1fgvP8116I-00a0QY; Thu, 25 Oct 2018 18:13:12 +0200 Received: from tor.lan ([195.198.252.176]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LmLac-1fgvP8116I-00a0QY; Thu, 25 Oct 2018 18:13:12 +0200 From: tboegi@web.de To: git@vger.kernel.org Cc: =?utf-8?q?Torsten_B=C3=B6gershausen?= Subject: [PATCH v1 2/2] curl_off_t xcurl_off_t is not portable Date: Thu, 25 Oct 2018 18:13:10 +0200 Message-Id: <20181025161310.29249-1-tboegi@web.de> X-Mailer: git-send-email 2.19.0.271.gfe8321ec05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oEdpzoD1gxcN+sxrFEeFUUNNj9lQtArU4FT5bL 2ILhCpPsQE9o9+SvmuUMaURuseYRtn3ZlxCO/0JI2lPK9Ti1Y4= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Torsten Bögershausen Comparing signed and unsigned values is not always portable. When setting DEVELOPER = 1 DEVOPTS = extra-all "gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516" errors out with "comparison is always false due to limited range of data type" "[-Werror=type-limits]" Solution: Use a valid cast & compare, similar to xsize_t() Signed-off-by: Torsten Bögershausen --- remote-curl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index 762a55a75f..c89fd6d1c3 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -618,9 +618,10 @@ static int probe_rpc(struct rpc_state *rpc, struct slot_results *results) } static curl_off_t xcurl_off_t(ssize_t len) { - if (len > maximum_signed_value_of_type(curl_off_t)) + curl_off_t size = (curl_off_t) len; + if (len != (ssize_t) size) die("cannot handle pushes this big"); - return (curl_off_t) len; + return size; } static int post_rpc(struct rpc_state *rpc)