From owner-svn-src-head@freebsd.org Fri Dec 4 16:06:26 2020 Return-Path: Delivered-To: svn-src-head@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 60DF64A45CE; Fri, 4 Dec 2020 16:06:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CncyV1kxPz4vCj; Fri, 4 Dec 2020 16:06:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id AA7D02602AA; Fri, 4 Dec 2020 17:06:23 +0100 (CET) Subject: Re: svn commit: r368329 - head/stand/kshim To: Alexander Richardson Cc: src-committers , svn-src-all , svn-src-head , Konstantin Belousov References: <202012041450.0B4EouQ2024632@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <6f9541e4-b216-8a93-881e-e3859bff84fa@selasky.org> Date: Fri, 4 Dec 2020 17:06:13 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CncyV1kxPz4vCj X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2020 16:06:26 -0000 On 12/4/20 4:59 PM, Alexander Richardson wrote: > On Fri, 4 Dec 2020 at 14:51, Hans Petter Selasky wrote: >> >> Author: hselasky >> Date: Fri Dec 4 14:50:55 2020 >> New Revision: 368329 >> URL: https://svnweb.freebsd.org/changeset/base/368329 >> >> Log: >> Fix definition of int64_t and uint64_t when long is 64-bit. This gets the kernel >> shim code in line with the rest of the kernel, sys/x86/include/_types.h. >> >> MFC after: 1 week >> Sponsored by: Mellanox Technologies // NVIDIA Networking >> >> Modified: >> head/stand/kshim/bsd_kernel.h >> >> Modified: head/stand/kshim/bsd_kernel.h >> ============================================================================== >> --- head/stand/kshim/bsd_kernel.h Fri Dec 4 14:09:12 2020 (r368328) >> +++ head/stand/kshim/bsd_kernel.h Fri Dec 4 14:50:55 2020 (r368329) >> @@ -208,9 +208,17 @@ typedef unsigned int uint32_t; >> #define _INT32_T_DECLARED >> typedef signed int int32_t; >> #define _UINT64_T_DECLARED >> +#ifndef __LP64__ >> typedef unsigned long long uint64_t; >> +#else >> +typedef unsigned long uint64_t; >> +#endif >> #define _INT16_T_DECLARED >> +#ifndef __LP64__ >> typedef signed long long int64_t; >> +#else >> +typedef signed long int64_t; >> +#endif >> >> typedef uint16_t uid_t; >> typedef uint16_t gid_t; > > Since we no longer support ancient compilers, could we simplify this > and just use > typedef __UINT64_TYPE__ uint64_t; > typedef __INT64_TYPE__ int64_t; > ? > > This will work across all architectures and ABIs, and appears to work > starting with GCC 4.5.3 and Clang 3.5: > https://godbolt.org/z/TWavfb Hi Alexander, I'm not sure how that definition will work together with existing code, mixing uint64_t, unsigned long, and unsigned long long. Will this cause more compiler warnings? This also will affect user-space and ports. Maybe Konstantin, CC'ed, has some input on this? --HPS