From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id DF0103858C60 for ; Sat, 29 Apr 2023 13:12:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF0103858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2a8ba693f69so7442801fa.0 for ; Sat, 29 Apr 2023 06:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682773947; x=1685365947; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qpd24/Qpi5JsGW9axL32T4laZ772/Mx7NaPGIWsiyWs=; b=ZrYTNMoX/HjaPJ/jWWqfu25+xHHkUvFVfBj2frPFwJFULhHgfz7HC3LvnG3XJv7IKl Ys2NqwfuqPX++2bp4IdgNJi5uZjtiEqfr2Mg+YgpTzynZKIuz3/gYzdRULhVa/J1+5ta 2egP+/gvvC91dmbY5PDCMlJxYHO1oulDzCSQuhx4v8zYA08zP5rJTk557pmgxy83pJOu a9BkU7zescYKfRvwiDtWQgis6sHWK5kUXKrzAIBfLFysbQBDdkr4yeYxMMMd3r62e5vn Vg8g7+R7FSs/3V0IHO4eoR+fM8Tn2/20VEQkEWfK4LLl+KO69P/8Vb7XBBDlSVBWTgLx yCCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682773947; x=1685365947; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qpd24/Qpi5JsGW9axL32T4laZ772/Mx7NaPGIWsiyWs=; b=W6Vr/Yb+ZLlmn5OQmw9MubfsqfOaZ7I260rCh1Ehz4NkBLON96zoZ1ZkrjbbqAZBNX XbrHHNLto2jzq7nlXVSa7tgvD6KMpjG++AD6Te7x2b4erzeYuK0dpxkITzMz7DFnf0H1 kEpM9XL9qN4nnLYCMpZrnZqO/JGSVlo5ljTAk6QlSTw0nZjFxHuWKUP4N0Cx1HhW8Ick cJ0DDVPUEmK0t/EemP22Xz0yUo59Ol9WWjLs+gMV8LkPuTqyQss1+OXz5t41mkLj+7TN 8USz5uufQOqCDeFngzoDylyITBaWKoTRPbYMoYJScDllLb+YC/HdIj+ql6a+2qfttn7A hdyw== X-Gm-Message-State: AC+VfDzf15pg5tY6jGbrn6D6KE1b9mRVRhrOm85W3yWlBUGTgHPIT6xS rLHbytsgEaYMSn7jcK+ALMVYm+L74oOwAQ== X-Google-Smtp-Source: ACHHUZ5QUjUv5FRw+O4ffq48V/HrVZ7qZ7Kn8M1eGhsBbV/5a+WCOp8yyneUbFd+Vu+a7s6eX1y70Q== X-Received: by 2002:a2e:9087:0:b0:2a7:7ff7:9215 with SMTP id l7-20020a2e9087000000b002a77ff79215mr2351853ljg.10.1682773946985; Sat, 29 Apr 2023 06:12:26 -0700 (PDT) Received: from surface-pro-6.. ([2a00:1370:818c:4a57:8a14:19ba:9e6b:1866]) by smtp.gmail.com with ESMTPSA id u21-20020a2e8455000000b002a8e8c776e9sm3736870ljh.56.2023.04.29.06.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Apr 2023 06:12:26 -0700 (PDT) From: Sergey Bugaev To: libc-alpha@sourceware.org Cc: bug-hurd@gnu.org, Samuel Thibault Subject: [PATCH 3/3] Mark various cold functions as __COLD Date: Sat, 29 Apr 2023 16:12:23 +0300 Message-Id: <20230429131223.2507236-3-bugaevc@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230429131223.2507236-1-bugaevc@gmail.com> References: <20230429131223.2507236-1-bugaevc@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: GCC docs explicitly list perror () as a good candidate for using __attribute__ ((cold)). So apply __COLD to perror () and similar functions. Signed-off-by: Sergey Bugaev --- include/error.h | 4 ++-- libio/stdio.h | 2 +- misc/err.h | 12 ++++++------ misc/error.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/error.h b/include/error.h index 9e96262f..4db67cba 100644 --- a/include/error.h +++ b/include/error.h @@ -5,11 +5,11 @@ void __error_internal (int status, int errnum, const char *message, - va_list args, unsigned int mode_flags); + va_list args, unsigned int mode_flags) __COLD; void __error_at_line_internal (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, - va_list args, unsigned int mode_flags); + va_list args, unsigned int mode_flags) __COLD; #endif diff --git a/libio/stdio.h b/libio/stdio.h index 45ddafdf..2387590d 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -859,7 +859,7 @@ extern int ferror_unlocked (FILE *__stream) __THROW __wur; This function is a possible cancellation point and therefore not marked with __THROW. */ -extern void perror (const char *__s); +extern void perror (const char *__s) __COLD; #ifdef __USE_POSIX diff --git a/misc/err.h b/misc/err.h index 0c752465..43df3a57 100644 --- a/misc/err.h +++ b/misc/err.h @@ -32,9 +32,9 @@ __BEGIN_DECLS /* Print "program: ", FORMAT, ": ", the standard error string for errno, and a newline, on stderr. */ extern void warn (const char *__format, ...) - __attribute__ ((__format__ (__printf__, 1, 2))); + __attribute__ ((__format__ (__printf__, 1, 2))) __COLD; extern void vwarn (const char *__format, __gnuc_va_list) - __attribute__ ((__format__ (__printf__, 1, 0))); + __attribute__ ((__format__ (__printf__, 1, 0))) __COLD; /* Likewise, but without ": " and the standard error string. */ extern void warnx (const char *__format, ...) @@ -44,13 +44,13 @@ extern void vwarnx (const char *__format, __gnuc_va_list) /* Likewise, and then exit with STATUS. */ extern void err (int __status, const char *__format, ...) - __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))) __COLD; extern void verr (int __status, const char *__format, __gnuc_va_list) - __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))) __COLD; extern void errx (int __status, const char *__format, ...) - __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))) __COLD; extern void verrx (int __status, const char *, __gnuc_va_list) - __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))) __COLD; #include #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 diff --git a/misc/error.h b/misc/error.h index 185b39c6..4fbd46c7 100644 --- a/misc/error.h +++ b/misc/error.h @@ -29,11 +29,11 @@ __BEGIN_DECLS If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ extern void error (int __status, int __errnum, const char *__format, ...) - __attribute__ ((__format__ (__printf__, 3, 4))); + __attribute__ ((__format__ (__printf__, 3, 4))) __COLD; extern void error_at_line (int __status, int __errnum, const char *__fname, unsigned int __lineno, const char *__format, ...) - __attribute__ ((__format__ (__printf__, 5, 6))); + __attribute__ ((__format__ (__printf__, 5, 6))) __COLD; /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this -- 2.40.1