From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tY+cISN3/Wqh1RsAWB0awg (envelope-from ) for ; Wed, 18 Nov 2026 05:00:03 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=r32i0A0f; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=IAiwYy4K; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=r32i0A0f; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=IAiwYy4K; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 57BC21E0BC; Wed, 18 Nov 2026 05:00:03 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EDFBB1E087 for ; Wed, 18 Nov 2026 05:00:00 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D374A4BA2E05 for ; Wed, 18 Nov 2026 09:59:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D374A4BA2E05 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=r32i0A0f; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=IAiwYy4K; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=r32i0A0f; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=IAiwYy4K Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id C4DE44BA2E05 for ; Wed, 18 Nov 2026 09:59:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4DE44BA2E05 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C4DE44BA2E05 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794995973; cv=none; b=DhG6ZP3e8uqMK5i/0IplyAamDtxR1vmkpmUxOWhJfyeA/ZXkj5sGv6OtPfcjnzwaJhkitlruisBeRnnUDRXvxWzABVJkkkNgoW/bPy9Z+PmG0B0nYaoiGtf6tsOplo4RRgtPi2gWsH6uJ3ZUpCtuHsfAHYimgCu8PBRLArYL4Vw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794995973; c=relaxed/simple; bh=OHEYWbkd+b0GDnQlMA+W9HKTuyRZYeoj56zUBMe5JbU=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=clKDaekEaBj1HjjGi1BLBiZYyOYBEasO4D9bzRUbHzqvp8PzlPMaRzLzw7bfF3YjOTFtoFPgAQdRKWzcZRD2rT5wyTMQltD5JGeVL/USu1MEDIJ7eRFFcPOWTeTH5zEgQjN3mKhfMjldriUBidTCEWkwDKS7S4JLHmQ5soM5Vh0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=r32i0A0f; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=IAiwYy4K; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=r32i0A0f; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=IAiwYy4K DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4DE44BA2E05 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id 683EF1F84A for ; Wed, 18 Nov 2026 09:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1794995972; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=m6JWen+CgeIqOaWU6ZJZDyR8npRe4oqWNUQ/NF6sfqg=; b=r32i0A0fGMWufqMjHw6k58mG9FBeqpB0H7qQJQIQZawBYvA1wCI4cWzQN9QtIqa3wQ4Par S44vUhlBtHGGFuNH1Y/yUOcKsnnIrmj0XlbOw55JKj3VTXC1iQ+/zv2CFHCQb11682oeHO Yw6Oco+d3GG9DpHurH5Jy5fovLO6K2g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1794995972; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=m6JWen+CgeIqOaWU6ZJZDyR8npRe4oqWNUQ/NF6sfqg=; b=IAiwYy4KWgfcW4HjDr/0LtyNQiVbW2s/Lx9D+fPXVcjunNw4z525s1mMlf5baOzGA91x7O 4t+SpLs9VrDu8JCQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1794995972; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=m6JWen+CgeIqOaWU6ZJZDyR8npRe4oqWNUQ/NF6sfqg=; b=r32i0A0fGMWufqMjHw6k58mG9FBeqpB0H7qQJQIQZawBYvA1wCI4cWzQN9QtIqa3wQ4Par S44vUhlBtHGGFuNH1Y/yUOcKsnnIrmj0XlbOw55JKj3VTXC1iQ+/zv2CFHCQb11682oeHO Yw6Oco+d3GG9DpHurH5Jy5fovLO6K2g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1794995972; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=m6JWen+CgeIqOaWU6ZJZDyR8npRe4oqWNUQ/NF6sfqg=; b=IAiwYy4KWgfcW4HjDr/0LtyNQiVbW2s/Lx9D+fPXVcjunNw4z525s1mMlf5baOzGA91x7O 4t+SpLs9VrDu8JCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 30C10134E9 for ; Wed, 18 Nov 2026 09:59:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id a3qpOgN3/WqQIQAAD6G6ig (envelope-from ) for ; Wed, 18 Nov 2026 09:59:32 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/build] Handle yyunput macro Date: Wed, 18 Nov 2026 10:59:31 +0100 Message-ID: <20261118095931.3217165-1-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-11.80 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[sourceware.org:url,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org [ The approach taken in this patch is conservative, intended to be suitable for backporting. A recently submitted patch [1] proposes to remove gdb/ada-lex.l, which also solves PR build/35015. ] In gdb/ada-lex.l, we have the following workaround: ... /* Dummy definition to suppress warnings about unused static definitions. */ typedef void (*dummy_function) (); dummy_function ada_flex_use[] = { (dummy_function) yyunput }; ... This stopped working for a range of flex versions (2.6.5 - 2.6.11) which define yyunput as a macro: ... #define yyunput(c) yyunput_r(...) ... [ Version 2.6.12 restores the previous situation using commit 160a160 ("fix(skel): restore the flex 2.6.4 yyunput function"). ] I ran into this on cygwin using 2.6.11. We can fix this using: ... #ifdef yyunput (dummy_function) yyunput_r #else (dummy_function) yyunput #endif ... but that seems fragile. We could use "%option nounput". It was added in 2.5.1, but with some bug that was fixed in 2.5.2, and on current trunk, we require >= 2.5.19 due to using --header-file. But on release branches we require >= 2.5.1, and using "%option nounput" would break support for 2.5.1. Instead, use YY_NO_YYUNPUT (available starting 2.6.5) to suppress the generation of yyunput, while falling back to ada_flex_use for < 2.6.5. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=35015 [1] https://sourceware.org/pipermail/gdb-patches/2026-November/231953.html --- gdb/ada-lex.l | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l index 857176c4d83..2085c0b618e 100644 --- a/gdb/ada-lex.l +++ b/gdb/ada-lex.l @@ -84,6 +84,26 @@ DIAGNOSTIC_IGNORE_REGISTER pstate->lexptr += 1; \ } +/* Starting v2.5.1, flex supports: + - YY_FLEX_MAJOR_VERSION and YY_FLEX_MINOR_VERSION + - YY_NO_UNPUT (though this was broken from v2.5.31 - v2.5.34) + Starting v2.5.22, flex supports: + - YY_FLEX_SUBMINOR_VERSION + Starting v2.6.5, flex supports: + - YY_NO_YYUNPUT + + The ada_flex_use workaround doesn't work for v2.6.5 - v2.6.11, and we can + use either YY_NO_UNPUT or YY_NO_YYUNPUT to fix this. Use YY_NO_YYUNPUT + because the supported check is easier. So, check for >= v2.6.5. */ +#if defined (YY_FLEX_MAJOR_VERSION) && defined (YY_FLEX_MINOR_VERSION) \ + && defined (YY_FLEX_SUBMINOR_VERSION) +#if (YY_FLEX_MAJOR_VERSION > 2) \ + || (YY_FLEX_MAJOR_VERSION == 2 && YY_FLEX_MINOR_VERSION > 6) \ + || (YY_FLEX_MAJOR_VERSION == 2 && YY_FLEX_MINOR_VERSION == 6 \ + && YY_FLEX_SUBMINOR_VERSION >= 5) +#define YY_NO_YYUNPUT +#endif +#endif %} %option case-insensitive interactive nodefault noyywrap @@ -336,11 +356,13 @@ lexer_init (FILE *inp) } /* namespace ada_exp_parser */ +#ifndef YY_NO_YYUNPUT /* Dummy definition to suppress warnings about unused static definitions. */ typedef void (*dummy_function) (); dummy_function ada_flex_use[] = { (dummy_function) yyunput }; +#endif DIAGNOSTIC_POP base-commit: 23953c373348a015b6243374216d460bec958672 -- 2.51.0