From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id BCF4D3857351 for ; Sat, 29 Apr 2023 15:06:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BCF4D3857351 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psmA6-0002h3-6B; Sat, 29 Apr 2023 11:06:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=In-Reply-To:MIME-Version:References:Subject:To:From: Date; bh=QxNLAN/l1lHN4KGcTefF3uD8AF4w5N5ojnYWkkCSI8I=; b=Ia7SFtXvk3TkpekIvSUF m3XfnOzbB6ThFqXwL4txjbBxr/FYm1osZ5yQI51gPh7UBpv6lec42y76KH02txXaMZwX1ePabXP2X 37MTKTKXIh2gL1q6T49juRCgVes5qLk6nFJVcFO0jIPnlzuf+VUMwHDZysa6SkQqnvSfACI9/MpQu LjqQ69IKuQS42wLEjCu/8skcfVBtyGq4mOvyhtlA3c/KXq8ComcM2kW0Lkt+r9c0jhWUAupwTLlx+ pqcOaAGqfSqZ6TqOdHKFefQWSSgPNXdWk5MfTGYIWRWQf2qIjamTXkCBvD+q/RygyRcP8OPp3JaA9 Hc6Ll+M7uMhCEg==; Received: from [2a01:cb19:4a:a400:de41:a9ff:fe47:ec49] (helo=begin.home) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psmA5-0004pe-O6; Sat, 29 Apr 2023 11:06:57 -0400 Received: from samy by begin.home with local (Exim 4.96) (envelope-from ) id 1psmA3-002F0Z-27; Sat, 29 Apr 2023 17:06:55 +0200 Date: Sat, 29 Apr 2023 17:06:55 +0200 From: Samuel Thibault To: Sergey Bugaev Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Subject: Re: [PATCH 3/3] Mark various cold functions as __COLD Message-ID: <20230429150655.uhvqgh4j56vsnshv@begin> Mail-Followup-To: Sergey Bugaev , libc-alpha@sourceware.org, bug-hurd@gnu.org References: <20230429131223.2507236-1-bugaevc@gmail.com> <20230429131223.2507236-3-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230429131223.2507236-3-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,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: It looks sensible to me indeed, any opinion from somebody else? Sergey Bugaev, le sam. 29 avril 2023 16:12:23 +0300, a ecrit: > 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 > -- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.