From patchwork Sat Aug 15 22:18:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Patchwork-Id: 141487 X-Patchwork-Delegate: fweimer@redhat.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F98B4BA2E20 for ; Sat, 15 Aug 2026 22:21:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F98B4BA2E20 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=aarsen.me header.i=@aarsen.me header.a=rsa-sha256 header.s=MBO0001 header.b=OejKiW17 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by sourceware.org (Postfix) with ESMTPS id B28174BA2E04 for ; Sat, 15 Aug 2026 22:20:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B28174BA2E04 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B28174BA2E04 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=80.241.56.151 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786832459; cv=none; b=Z55zrBdm7LcY9xv/9a1t0Rd15VZZeloBjj/BsRkxmwGPBx4nOYhtzPfY3HZjDcQKcMZnnONgM45KZ0K3rLoJarvJt0nr6AZqHue+xOugnsJ2OzNrbg3dFUnhsuFu1ESG8jvr0WHlMAl7l6VhhfkeHVgLfYaZ+qrbauezsYurWTA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786832459; c=relaxed/simple; bh=mKFYJkLh1CysWA9O8siEBLPJkguOsg6uhyPvkPH9Q0g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rImuS8Zaoj/JdJ5ipSEU0fwhk/jgtTUx3mcmQYCVkpYo+tAlp5FJoxuYMAw3vdSQ6FMOrG4iY9xB8YiAHFfd1XTUQot7dA4LbuTTgf4RIU1o2I9EDL0vzroQR86kMpuuu4Co4k6h7JeGUEdQiVCLhBgStlxqyl2elHlk/A1Zkak= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=aarsen.me header.i=@aarsen.me header.a=rsa-sha256 header.s=MBO0001 header.b=OejKiW17 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B28174BA2E04 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (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) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4hMtpY60gmz8sYd; Sun, 16 Aug 2026 00:20:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1786832453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=300JWMDuw5vtmhhgCzKIfk7Enc8TtePoXrX1G9U8d48=; b=OejKiW17QFpyJwqszffyuONuKFafrI6HBx1TuA0T+WBpFCy6vdWYl8Qb/HZJLyj81VguVc rCAOW5JCKiKolWtQ11dH3hilfbAP687nDUtIlfP7wcFcQm2UGS3MZ7r9OILx3s+Wh26+4a A5HcUr7u6iywkg7hmJSzolvQ0ccjSjYx7lgNu3P4FhQoIy3aYKNkd2p2c5O5KPrSRTxko6 pC0uPATHwmKaFwGiVWpYW7ajN8nzc3nPti6G6cq+P52HMo/iG/k1anaCkUA/pkrKf54PTP Km9iMLW5T+ah8EnMsKKDW+rh13Q+F8n0rSUuCkq+uZ8scG/4ygkRfgMgAPr1Hw== From: =?utf-8?q?Arsen_Arsenovi=C4=87?= To: libc-alpha@sourceware.org Cc: =?utf-8?q?Arsen_Arsenovi=C4=87?= Subject: [PATCH] features.h: do not consider _GNU_SOURCE for gets Date: Sun, 16 Aug 2026 00:18:45 +0200 Message-ID: <20260815222047.1510706-1-arsen@aarsen.me> MIME-Version: 1.0 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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 Currently, -std=c99 -D_GNU_SOURCE and similar lack the 'gets' declaration. This causes, say, programs using the: extern __typeof__ (gets) function __attribute__ ((__warning__ (...))) ... trick to add warnings to 'gets' use to break. (_GL_WARN_ON_USE in gnulib). The decision not to declare 'gets' w/ _GNU_SOURCE is clearly intended (see c3a87236702cb73be1dada3438bbd3c3934e83f8), but I don't see the benefit in it (given that we already emit a diagnostic), and, as noted, it does cause certain older versions of Gnulib to fail to compile (which, in turn, causes multiple packages to fail to compile while building), and no rationale was provided in the commit message. It was not unreasonable for programs to assume that _GNU_SOURCE does not remove declarations, I think. So, let's keep it in -std=gnu99/c99 -D_GNU_SOURCE instead. One test needed to ignore the 'gets' deprecation now, since it became exposed to the deprecated declaration. --- Tested on x86_64-linux-gnu. Four failures that seem to be definitely unrelated (the GDB ones are a GDB crash, the malloc one is a timeout, and tst-pthread-exited seems to get EPERMs for some reason): ~/gnu/glibc/glibc/_b$ grep ^FAIL tests.sum FAIL: malloc/tst-malloc-tcache-leak-malloc-largetcache FAIL: nptl/tst-pthread-exited FAIL: nptl/tst-pthread-gdb-attach FAIL: nptl/tst-pthread-gdb-attach-static I'd debug this normally, but it's getting late.. include/features.h | 4 +++- libio/Makefile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/features.h b/include/features.h index b3277f342cd6..a3f483fa7869 100644 --- a/include/features.h +++ b/include/features.h @@ -475,7 +475,9 @@ safely. It has been removed from ISO C11 and ISO C++14. Note: for compatibility with various implementations of , this test must consider only the value of __cplusplus when compiling C++. */ -#if defined __cplusplus ? __cplusplus >= 201402L : defined __USE_ISOC11 +#if (defined __cplusplus \ + ? __cplusplus >= 201402L \ + : (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define __GLIBC_USE_DEPRECATED_GETS 0 #else # define __GLIBC_USE_DEPRECATED_GETS 1 diff --git a/libio/Makefile b/libio/Makefile index 616107ee105b..836a9dbb70d4 100644 --- a/libio/Makefile +++ b/libio/Makefile @@ -258,7 +258,7 @@ CFLAGS-oldtmpfile.c += -fexceptions # Prevent fortification as these are built with -O0 CFLAGS-tst-bz24051.c += $(no-fortify-source) -CFLAGS-tst-bz24153.c += $(no-fortify-source) +CFLAGS-tst-bz24153.c += $(no-fortify-source) -Wno-deprecated-declarations CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"