From owner-svn-src-all@freebsd.org Sat Dec 21 02:44:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3DF61EC899; Sat, 21 Dec 2019 02:44:38 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fqhQ58hmz3GpW; Sat, 21 Dec 2019 02:44:38 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC28D8A6A; Sat, 21 Dec 2019 02:44:38 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBL2icSd088605; Sat, 21 Dec 2019 02:44:38 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2icr2088604; Sat, 21 Dec 2019 02:44:38 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210244.xBL2icr2088604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355975 - head/contrib/jemalloc/src X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/contrib/jemalloc/src X-SVN-Commit-Revision: 355975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:44:38 -0000 Author: rlibby Date: Sat Dec 21 02:44:38 2019 New Revision: 355975 URL: https://svnweb.freebsd.org/changeset/base/355975 Log: jemalloc: pick from upstream: Fix GCC-9.1 warning with macro GET_ARG_NUMERIC Pick 2d6d099fed05b1509e81e54458516528bfbbf38d from upstream jemalloc: Fix GCC-9.1 warning with macro GET_ARG_NUMERIC GCC-9.1 reports following error when trying to compile file src/malloc_io.c and with CFLAGS='-Werror' : src/malloc_io.c: In function ‘malloc_vsnprintf’: src/malloc_io.c:369:2: error: case label value exceeds maximum value for type [-Werror] 369 | case '?' | 0x80: \ | ^~~~ src/malloc_io.c:581:5: note: in expansion of macro ‘GET_ARG_NUMERIC’ 581 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ ... cc1: all warnings being treated as errors make: *** [Makefile:388: src/malloc_io.sym.o] Error 1 The warning is reported as by default the type 'char' is 'signed char' and or-ing 0x80 will turn the case label char negative which will be beyond the printable ascii range (0 - 127). The patch fixes this by explicitly casting the 'len' variable as unsigned char' inside the 'switch' statement so that value of expression " '?' | 0x80 " falls within the legal values of the variable 'len'. Discussed with: jasone (maintainer) Sponsored by: Dell EMC Isilon Modified: head/contrib/jemalloc/src/malloc_io.c Modified: head/contrib/jemalloc/src/malloc_io.c ============================================================================== --- head/contrib/jemalloc/src/malloc_io.c Sat Dec 21 02:44:26 2019 (r355974) +++ head/contrib/jemalloc/src/malloc_io.c Sat Dec 21 02:44:38 2019 (r355975) @@ -376,7 +376,7 @@ malloc_vsnprintf(char *str, size_t size, const char *f } \ } while (0) #define GET_ARG_NUMERIC(val, len) do { \ - switch (len) { \ + switch ((unsigned char)len) { \ case '?': \ val = va_arg(ap, int); \ break; \