From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GdNDHM9QzmqloAIAWB0awg (envelope-from ) for ; Tue, 13 Oct 2026 11:39:59 -0400 Received: by simark.ca (Postfix, from userid 112) id 685E11E051; Tue, 13 Oct 2026 11:39:59 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 9350E1E04E for ; Tue, 13 Oct 2026 11:39:58 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 41D0F4BA900A for ; Tue, 13 Oct 2026 15:39:58 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D7F694BA23FB for ; Tue, 13 Oct 2026 15:39:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7F694BA23FB Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D7F694BA23FB Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791905954; cv=none; b=NYaackyVx/2KscWNXw561+NRSlBVz4HbHM9ucN5M1hAjAI0zfVolOJFPDMGpxKw8Ra2Y8rHJyACo1E/Y6J3k5R8v0tDeUPQoX80EqeKQ3pXZfjWz6wgfdoZsZGN28WqRBTKcLgreRC40u2suvwI7MSwzcM5t4DPEeZ78ANwhM5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791905954; c=relaxed/simple; bh=uc1c1tmh2b1rCZIirSyg9EdtN2cYJDjooehRjusI2D8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ufq5yyeDM34taQoXnhXYnDDhT7R+BXnFbGNexrAniIVTsDv3HYzwPSVV7cQViDef7gubDmKxT3YQbq6BTHrVBnjHRn4hMaV6mOsYRKv6UkDK4fJ98DX4/pbqAYH6RO73pLDX2CyFy7lW1AjJnOubrCB8FrhDnJaICy1BM4gTerU= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7F694BA23FB Received: by simark.ca (Postfix) id 959911E09E; Tue, 13 Oct 2026 11:39:11 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 14/16] gdbserver: remove fallback declarations of perror, vasprintf and vsnprintf Date: Tue, 13 Oct 2026 11:36:00 -0400 Message-ID: <20261013153657.1610298-15-simon.marchi@efficios.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013153657.1610298-1-simon.marchi@efficios.com> References: <20261013153657.1610298-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 server.h declares perror, vasprintf and vsnprintf if configure did not find a declaration for them. perror and vsnprintf are standard C++, and libiberty.h already declares vasprintf and vsnprintf when the system doesn't. Remove the fallback declarations from server.h, and the AC_CHECK_DECLS call from configure.ac. Regenerate config.in and configure. Change-Id: I6afe4a6fa610a37599b7b7d28628dea43b584892 --- gdbserver/config.in | 4 ---- gdbserver/configure | 32 -------------------------------- gdbserver/configure.ac | 2 -- gdbserver/server.h | 13 ------------- 4 files changed, 51 deletions(-) diff --git a/gdbserver/config.in b/gdbserver/config.in index d0b609003800..7aae2f7398b5 100644 --- a/gdbserver/config.in +++ b/gdbserver/config.in @@ -58,10 +58,6 @@ /* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ #undef HAVE_DECL_FFS -/* Define to 1 if you have the declaration of `perror', and to 0 if you don't. - */ -#undef HAVE_DECL_PERROR - /* Define to 1 if you have the declaration of `snprintf', and to 0 if you don't. */ #undef HAVE_DECL_SNPRINTF diff --git a/gdbserver/configure b/gdbserver/configure index d695c6191e33..9555b15bd725 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -13228,38 +13228,6 @@ _ACEOF -ac_fn_c_check_decl "$LINENO" "perror" "ac_cv_have_decl_perror" "$ac_includes_default" -if test "x$ac_cv_have_decl_perror" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PERROR $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" "$ac_includes_default" -if test "x$ac_cv_have_decl_vasprintf" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VASPRINTF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default" -if test "x$ac_cv_have_decl_vsnprintf" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VSNPRINTF $ac_have_decl -_ACEOF - - ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #if HAVE_SYS_SOCKET_H # include diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac index 1f461fa05727..2ae3e1c6e494 100644 --- a/gdbserver/configure.ac +++ b/gdbserver/configure.ac @@ -102,8 +102,6 @@ LIBS="$old_LIBS" libiberty_INIT -AC_CHECK_DECLS([perror, vasprintf, vsnprintf]) - AC_CHECK_TYPES(socklen_t, [], [], [#include #if HAVE_SYS_SOCKET_H diff --git a/gdbserver/server.h b/gdbserver/server.h index bbba3650de7d..1a9e6ef62f8a 100644 --- a/gdbserver/server.h +++ b/gdbserver/server.h @@ -33,19 +33,6 @@ static_assert (sizeof (CORE_ADDR) >= sizeof (void *)); #include "gdbsupport/version.h" -#if !HAVE_DECL_PERROR -#ifndef perror -extern void perror (const char *); -#endif -#endif - -#if !HAVE_DECL_VASPRINTF -extern int vasprintf(char **strp, const char *fmt, va_list ap); -#endif -#if !HAVE_DECL_VSNPRINTF -int vsnprintf(char *str, size_t size, const char *format, va_list ap); -#endif - #ifdef IN_PROCESS_AGENT # define PROG "ipa" #else -- 2.56.0