From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 4C20C3858418 for ; Wed, 4 May 2022 17:05:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C20C3858418 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-210-a_jt772oPiOeck99Gjkcmw-1; Wed, 04 May 2022 13:05:33 -0400 X-MC-Unique: a_jt772oPiOeck99Gjkcmw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A8F09800B21; Wed, 4 May 2022 17:05:31 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DD7E454A52; Wed, 4 May 2022 17:05:30 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org, "H.J. Lu" Subject: Re: [PATCH v2 2/3] Linux: Implement a useful version of _startup_fatal References: <63235b8cfce808ff0c6fd07d5710faaf2e692f88.1651682800.git.fweimer@redhat.com> <2dbba551-94f2-cbeb-9b94-2e8e1bd8ef5a@linaro.org> Date: Wed, 04 May 2022 19:05:28 +0200 In-Reply-To: <2dbba551-94f2-cbeb-9b94-2e8e1bd8ef5a@linaro.org> (Adhemerval Zanella's message of "Wed, 4 May 2022 14:01:01 -0300") Message-ID: <87r159p6sn.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2022 17:05:37 -0000 * Adhemerval Zanella: > On 04/05/2022 13:48, Florian Weimer wrote: >> diff --git a/sysdeps/unix/sysv/linux/startup.h b/sysdeps/unix/sysv/linux/startup.h >> new file mode 100644 >> index 0000000000..a5de941759 >> --- /dev/null >> +++ b/sysdeps/unix/sysv/linux/startup.h >> @@ -0,0 +1,38 @@ >> +/* Linux definitions of functions used by static libc main startup. >> + Copyright (C) 2017-2022 Free Software Foundation, Inc. >> + This file is part of the GNU C Library. >> + >> + The GNU C Library is free software; you can redistribute it and/or >> + modify it under the terms of the GNU Lesser General Public >> + License as published by the Free Software Foundation; either >> + version 2.1 of the License, or (at your option) any later version. >> + >> + The GNU C Library is distributed in the hope that it will be useful, >> + but WITHOUT ANY WARRANTY; without even the implied warranty of >> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> + Lesser General Public License for more details. >> + >> + You should have received a copy of the GNU Lesser General Public >> + License along with the GNU C Library; if not, see >> + . */ >> + >> +#ifdef SHARED >> +# include_next >> +#else >> +# include >> + >> +/* Avoid a run-time invocation of strlen. */ >> +#define _startup_fatal(message) \ >> + do \ >> + { \ >> + size_t message_length = __builtin_strlen (message); \ > > Shoudn't we use double underscore name to avoid clash with local > variables? I think it's a problem only if message expands to something that uses message_length, which is as likely as __message_length. message can't be a complex expression anyway because we don't want to call strlen at this point. Thanks, Florian