From nobody Fri Jun 21 02:41:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W51nw1wXBz5PH3S; Fri, 21 Jun 2024 02:41:24 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W51nv3v4Zz4c2r; Fri, 21 Jun 2024 02:41:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718937683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C77Yz4LTzokiKWlzVMk40X3PESxKkLbP1Y7KaLkD8N8=; b=vl0vcl7AIEUmdPzuNIhIq6//tyu5dPP6cRQNipU+w6GSaKKb2pwdGNDg/kQDvFqzgdS3QE VtPUdhLEwBBFifVQhPGakPUmFuZZP5CBP5KQvTdHZyi7llr0tPa7jf5xsx63OMqLlJdLTI ZeIYAwjJvM1ebWMsPhTSp45zBlsO86uWPBHwL6qCTlSbC6buOxbpEJW7g0ByvmjPTD7KA+ DDWsUpCjJKVsvVsbEi6dvIUAubg4ikjAD3ae0u1T1aFlPhjfo7FWdgDGC/vLrHXWqkzqXr vJSbQLZjZysb9vQ9tfzTCmmyxRMWYrS2uRByggmFfHElRiJl9TxtfgcKcQ9Eww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718937683; a=rsa-sha256; cv=none; b=cxPkKQRaJakshqI3wY4GCOsnnPcHu9fMTIA8pdsdhCJadxOqnW0S8ebj8ykBRXSNuNqaw+ 3LZY1UXnGvFlSoWd77ySqQGp6MmVjs322p2lwtvr+hNO3+fF7bEENjzn4v9l5KfsKm3H8H Oyv8wbsikedAqc9o2zBUD0TnNYpswjD60QQrNZBSQJGSNZO1Tu0bQlJIzcZjWM5Um0ms9v LHXmPcRi3VeGPJdUCjEcdKpeLdhx7TExquH/CnZKY54v73NT5uLjwY0td3/rTv5Gtrqmhu YCpyCmQyzeE+PQKh6q9Ffa1XH6fHNtzoLVYVl3CeNs7q0zNAIsjTMbo6gxlmpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718937683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C77Yz4LTzokiKWlzVMk40X3PESxKkLbP1Y7KaLkD8N8=; b=vWoWl52R3wxAV3yx6GRMzEJfe7/a0614xA26b24v1noCV9Aal027B6eDmWVAiNM2ikMq/Q sRzSdJoarimR+Z5CjQJxNWmtDQiB5S9N8UnKtgoHPLxJIBjASOCpbCf+F5xT1g4B+vW5rT nEUjirvqqGd/TG48gfIdkPcRo3Lek8FhWD4/j5Zpp6zngrhfVFOgDavWQHo6Hw5kovVwod Wwia1R4YnfhP5pMBADG2y36Ua37qzYNUKbbiY6DVRGGzxYujxYZ/lBUZlyCJdW5aF1IJ3E TsM8a31nf+sOB0JajZnipx45oH15+PUB2FJiAr+NAhxmUab0yVILIdCRd9dRiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W51nv3Vspzqy3; Fri, 21 Jun 2024 02:41:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45L2fNm7056965; Fri, 21 Jun 2024 02:41:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45L2fNU2056962; Fri, 21 Jun 2024 02:41:23 GMT (envelope-from git) Date: Fri, 21 Jun 2024 02:41:23 GMT Message-Id: <202406210241.45L2fNU2056962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2508372b7b46 - main - cdefs.h: Assume the compiler supports at least GNU C 3.0 extensions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2508372b7b46117a9fb801b50624265d30888442 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2508372b7b46117a9fb801b50624265d30888442 commit 2508372b7b46117a9fb801b50624265d30888442 Author: Warner Losh AuthorDate: 2024-06-20 23:02:42 +0000 Commit: Warner Losh CommitDate: 2024-06-21 02:41:08 +0000 cdefs.h: Assume the compiler supports at least GNU C 3.0 extensions All compilers that can build FreeBSD binaries (as opposed to the entire system) support at least gcc 9 (gcc, clang, tcc). Even pcc supports most of the gcc 4.3 attributes. Make this file simpler by removing support for pre-3.0 compilers. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D45653 Sponsored by: Netflix --- sys/sys/cdefs.h | 79 +-------------------------------------------------------- 1 file changed, 1 insertion(+), 78 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 476c89d1dddb..88019819eb35 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -160,18 +160,6 @@ * a feature that we cannot live without. */ #define __weak_symbol __attribute__((__weak__)) -#if !__GNUC_PREREQ__(2, 5) -#define __dead2 -#define __pure2 -#define __unused -#endif -#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 -#define __dead2 __attribute__((__noreturn__)) -#define __pure2 __attribute__((__const__)) -#define __unused -/* XXX Find out what to do for __packed, __aligned and __section */ -#endif -#if __GNUC_PREREQ__(2, 7) #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) #define __unused __attribute__((__unused__)) @@ -179,7 +167,6 @@ #define __packed __attribute__((__packed__)) #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) -#endif #define __writeonly __unused #if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__) #define __alloc_size(x) __attribute__((__alloc_size__(x))) @@ -194,10 +181,6 @@ #define __alloc_align(x) #endif -#if !__GNUC_PREREQ__(2, 95) -#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) -#endif - /* * Keywords added in C11. */ @@ -304,13 +287,8 @@ #define __min_size(x) (x) #endif -#if __GNUC_PREREQ__(2, 96) #define __malloc_like __attribute__((__malloc__)) #define __pure __attribute__((__pure__)) -#else -#define __malloc_like -#define __pure -#endif #if __GNUC_PREREQ__(3, 1) #define __always_inline __attribute__((__always_inline__)) @@ -355,7 +333,7 @@ #define __unreachable() ((void)0) #endif -#if (defined(__GNUC__) && __GNUC__ >= 2) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 +#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 #define __LONG_LONG_SUPPORTED #endif @@ -389,45 +367,10 @@ */ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 #define __restrict restrict -#elif !__GNUC_PREREQ__(2, 95) -#define __restrict #endif -/* - * GNU C version 2.96 adds explicit branch prediction so that - * the CPU back-end can hint the processor and also so that - * code blocks can be reordered such that the predicted path - * sees a more linear flow, thus improving cache behavior, etc. - * - * The following two macros provide us with a way to utilize this - * compiler feature. Use __predict_true() if you expect the expression - * to evaluate to true, and __predict_false() if you expect the - * expression to evaluate to false. - * - * A few notes about usage: - * - * * Generally, __predict_false() error condition checks (unless - * you have some _strong_ reason to do otherwise, in which case - * document it), and/or __predict_true() `no-error' condition - * checks, assuming you want to optimize for the no-error case. - * - * * Other than that, if you don't know the likelihood of a test - * succeeding from empirical or other `hard' evidence, don't - * make predictions. - * - * * These are meant to be used in places that are run `a lot'. - * It is wasteful to make predictions in code that is run - * seldomly (e.g. at subsystem initialization time) as the - * basic block reordering that this affects can often generate - * larger code. - */ -#if __GNUC_PREREQ__(2, 96) #define __predict_true(exp) __builtin_expect((exp), 1) #define __predict_false(exp) __builtin_expect((exp), 0) -#else -#define __predict_true(exp) (exp) -#define __predict_false(exp) (exp) -#endif #if __GNUC_PREREQ__(4, 0) #define __null_sentinel __attribute__((__sentinel__)) @@ -481,13 +424,6 @@ * that are known to support the features properly (old versions of gcc-2 * didn't permit keeping the keywords out of the application namespace). */ -#if !__GNUC_PREREQ__(2, 7) -#define __printflike(fmtarg, firstvararg) -#define __scanflike(fmtarg, firstvararg) -#define __format_arg(fmtarg) -#define __strfmonlike(fmtarg, firstvararg) -#define __strftimelike(fmtarg, firstvararg) -#else #define __printflike(fmtarg, firstvararg) \ __attribute__((__format__ (__printf__, fmtarg, firstvararg))) #define __scanflike(fmtarg, firstvararg) \ @@ -497,7 +433,6 @@ __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) #define __strftimelike(fmtarg, firstvararg) \ __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) -#endif /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ @@ -508,7 +443,6 @@ #define __printf0like(fmtarg, firstvararg) #endif -#if defined(__GNUC__) #define __strong_reference(sym,aliassym) \ extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) #ifdef __STDC__ @@ -536,22 +470,11 @@ #define __sym_default(impl,sym,verid) \ __asm__(".symver impl, sym@@@verid") #endif /* __STDC__ */ -#endif /* __GNUC__ */ #define __GLOBL(sym) __asm__(".globl " __XSTRING(sym)) #define __WEAK(sym) __asm__(".weak " __XSTRING(sym)) -#if defined(__GNUC__) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") -#else -/* - * The following definition might not work well if used in header files, - * but it should be better than nothing. If you want a "do nothing" - * version, then it should generate some harmless declaration, such as: - * #define __IDSTRING(name,string) struct __hack - */ -#define __IDSTRING(name,string) static const char name[] __unused = string -#endif /* * Embed the rcs id of a source file in the resulting library. Note that in