From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WEtJLPv/ImQGMBwAWB0awg (envelope-from ) for ; Tue, 28 Mar 2023 10:55:55 -0400 Received: by simark.ca (Postfix, from userid 112) id A3F5E1E4A3; Tue, 28 Mar 2023 10:55:55 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QXaG1tE8; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 896731E0D2 for ; Tue, 28 Mar 2023 10:55:54 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 60FB6385843A for ; Tue, 28 Mar 2023 14:55:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60FB6385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680015353; bh=QR+7ITv5RCSGBVDjrLTxepzVOuj6khwV4htgCXOAjZk=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=QXaG1tE8UsY672weF6X5n62F4hKun3MKhlNa89Aq3KQJxZC3zwAEmQPcQyfBjm8GS SYoMH/BBnFBVAaw32X1qcucPL3oeLE1/zyMGbE3zIgMaMNKsi2ad3TJ9ZfMcC94mzr svAAMMClSNzfvtoSQleK1mMk8NEuiYv+hB7p7iyM= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 5719C3858D39 for ; Tue, 28 Mar 2023 14:55:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5719C3858D39 Received: from [172.16.0.146] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 764C91E0D2; Tue, 28 Mar 2023 10:55:32 -0400 (EDT) Message-ID: <6379554d-4e45-0ff8-a972-47596ea83b90@simark.ca> Date: Tue, 28 Mar 2023 10:55:32 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] gdb: fix -Wdeprecated-declarations on macOS To: Enze Li , gdb-patches@sourceware.org Cc: enze.li@gmx.com References: Content-Language: fr In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 3/28/23 10:16, Enze Li via Gdb-patches wrote: > I noticed that there are some issues when compiling on macOS. There are > a few places where errors like the following are reported, > > ====== > CXX cli/cli-cmds.o > cli/cli-cmds.c:929:14: error: 'vfork' is deprecated: Use posix_spawn or fork [-Werror,-Wdeprecated-declarations] > if ((pid = vfork ()) == 0) > ^ > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:604:1: note: 'vfork' has been explicitly marked deprecated here > __deprecated_msg("Use posix_spawn or fork") > ^ > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:208:48: note: expanded from macro '__deprecated_msg' > #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg))) > ^ > 1 error generated. > ====== > > This patch is only available for the macOS platform. This is done by > using macros to differentiate between specific platforms. > > Tested by rebuilding both on x86_64 linux and macOS Big Sur. Any idea why vfork is deprecated on macOS? I can't find any answer online. I think it would be good to have a gdb_ util function with the ifdef at a single place, with an appropriate comment. I don't know how to call this function though. Would calling it gdb_vfork be misleading, because it won't always vfork? Simon