From patchwork Thu Oct 30 20:11:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Wong X-Patchwork-Id: 123036 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CE2803858C52 for ; Thu, 30 Oct 2025 20:13:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE2803858C52 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=yhbt.net header.i=@yhbt.net header.a=rsa-sha256 header.s=selector1 header.b=XzwN+5kU X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from dcvr.yhbt.net (dcvr.yhbt.net [173.255.242.215]) by sourceware.org (Postfix) with ESMTPS id 681D13858C66 for ; Thu, 30 Oct 2025 20:11:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 681D13858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yhbt.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yhbt.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 681D13858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=173.255.242.215 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761855112; cv=none; b=M6lo8xjhzYO3LRQIyHgvNqW234/wo19hqwRUiLd1qzrd0ZIS7KtP5/wXuhmNx4YnyJtTPkasoETzS+YujqCmUgWMYN/HTXy4iwQPFWSQgVbgL6sSAQEOTCXmHGq3mA0RXyldfxjvT8/Sv3AD1m1oLIeIvU+MNAwKpfUA27eOf54= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761855112; c=relaxed/simple; bh=oNvNDeRU1hcELKnJl/v8ZLCgdeP1xyjR2D2kqewKdRI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ZdAe7R1ioC11H7YW6pdBloWuNhTQnLTDhyHT9zZXW8DVa/dQf3IEn8ERZnSVX4pcQnfs43EHjV+98Cp9v0IvJ57S2znseW1VtQPozj7zMQMxHj7n8jwEXLf3OyK47rtqmTjrrY5MAz7jasNedyRQLeJyO5RwWsOrpCGiUD7OHdY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 681D13858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yhbt.net; s=selector1; t=1761855111; bh=oNvNDeRU1hcELKnJl/v8ZLCgdeP1xyjR2D2kqewKdRI=; h=Date:From:To:Cc:Subject:From; b=XzwN+5kUIAxH5c9rh5sMb1UTe+yxvUhpRTd975D/UPN7dzCHaK/cUIcJlf5V8WxQ+ HS5clKgY2vJmZVieBL4UBVNgprfYCpTvm+NxEO+xbevT6uQq86/txKjA0mcACdiWy6 R+H8g+8qOpE+IclLV0t3r/nr6uJejljlcOpeSEbA= Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5BAAD20331; Thu, 30 Oct 2025 20:11:51 +0000 (UTC) Date: Thu, 30 Oct 2025 20:11:51 +0000 From: Eric Wong To: bug-gnulib@gnu.org Cc: libc-alpha@sourceware.org Subject: [PATCH] cdefs: allow __attribute__ on tcc Message-ID: <20251030201151.M137083@dcvr> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org According to the tcc (tiny C compiler) Changelog, tcc supports __attribute__ since 0.9.3. Looking at history of tcc at , __attribute__ support was added in commit 14658993425878be300aae2e879560698e0c6c4c on 2002-01-03, which also looks like the release of 0.9.3. While I'm unable to find release tags for tcc before 0.9.18 (2003-04-14), the next release (0.9.28) will include __attribute__((cleanup(func)) which I rely on. Signed-off-by: Eric Wong Reviewed-by: Collin Funk --- This change also applies to glibc (where I encounted the problem), but glibc is a bigger source tree and I'm HW constrained, so I'd appreciate this change also being applied to glibc. Thanks. I have copyright assignments on file with the FSF. ChangeLog | 5 +++++ lib/cdefs.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b7f0310e00..35500be2ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-10-30 Eric Wong + + cdefs: allow __attribute__ on tcc + * lib/cdefs.h: Do not ignore __attribute__ on tcc. + 2025-10-30 Bruno Haible fprintftime: Avoid size_t overflow for very large outputs. diff --git a/lib/cdefs.h b/lib/cdefs.h index 2682c092f0..3bfb428511 100644 --- a/lib/cdefs.h +++ b/lib/cdefs.h @@ -280,7 +280,7 @@ /* GCC and clang have various useful declarations that can be made with the '__attribute__' syntax. All of the ways we use this do fine if they are omitted for compilers that don't understand it. */ -#if !(defined __GNUC__ || defined __clang__) +#if !(defined __GNUC__ || defined __clang__ || defined __TINYC__) # define __attribute__(xyz) /* Ignore */ #endif