From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 9DBA738708A6 for ; Fri, 26 Apr 2024 10:47:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DBA738708A6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9DBA738708A6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714128475; cv=none; b=koYJinXL7AMhKFbHbB4VLfBgqmcefxHtH6P5mPLEYg5QeQ7fcbbOYPqbTS9lWpRXMDbRqqQ25tmc+KLz2HaeYDTDv6sjbSlw1E44oAfrfW2iZbTgAssSK+vVh24BvCx8udYNrD3HGRAPVt2k/aBVEzCjbEM0c5E6K5HO4WgiqiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714128475; c=relaxed/simple; bh=zIJHX4TLPz8xovLm5hSobDHwV9ul56cnr0lWGnLaWX8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:Subject:From; b=wHxFBlgFtT/35w6q1wfVcqYI8HayhoqUg037PLK7UJ8m3jZ56dgyXsRU6rcF+PD9/rzSGFEi8XK52VFRnLY6HCRAsn/60/arPCno1Ewy0CkLkjED4VbT8WVm2aikAJq2JEHDjvplw9Go+qyo6YRNCv3axf/ZwMzIDkiNaJpVk6k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a556d22fa93so236211766b.3 for ; Fri, 26 Apr 2024 03:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1714128472; x=1714733272; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language:subject :references:cc:to:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=YcTTD+uLrcCPw1rT0tBR58X7aAlR/HjJEuWFRF7Bflc=; b=K4eSItJD8mvwpYH1GGoMoDF66JdoOIWl0WHD2GSmpx1L5VtgNEZ1SjoAcnVPURAhYb zarWbUGzt25m5Sm53udn/QyquXw4iPidFzJ8Zw52lanrCGONpC2ocFevqX1X57v0oUXN YQteG0QgCEp1eGtiUwLAjYxLXrFdZv0I5p8i8nz5cplFC6BWRCCB1HwJCTpTQcPOUf6W L7hvxP3+UQGOWO6WT+MYFA4QXCDxA79ksOCzhnqeWRz6EZJ1wddeHTP2E9a2QuKprhwO 9ofCOJzJwPT+vmQEL6k39x8Hfwl5Hpcv9HYgixcAZTnWxUE9LLpGqZwsYJhTGD0kC+Nf 73FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714128472; x=1714733272; h=content-transfer-encoding:in-reply-to:from:content-language:subject :references:cc:to:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YcTTD+uLrcCPw1rT0tBR58X7aAlR/HjJEuWFRF7Bflc=; b=Sa0waImHUNYBPDjoI9AH4+1ontueXWfOY84Bt0jeAAOZhg8Bj/t+kmEwnjgf4xCnY6 1z/EuKVVdvUIwTFwpl+9psSlHfKEiBwVWbzMoOqP98+vF99bF1cDbcLajaUcvjU75XNT 8RcginDtjKGn1F/LygjNnBbkAYxXxZSUh1+Uv6qkxLj1vmd7/HYsx+aEDgSWVTCy0FPb Tm06T0CZXFcZnfg7wRL9AMIkbcWdasYn5LcppGi77+iH2k1QoK+s6xEADLXV4+LCA5/z 96vV1WIRM2FXoyqk8XNovvf2KOA1tuAmwAzcdUANwl1jcRP7gRDH577cLy9FyJh7O5wG hg3w== X-Gm-Message-State: AOJu0Yxmdj/cMWWiOE7hhhm0v3Ywj6tOr3iNqTbciYKx+7B4t85FgFUu iM7YatOcgFs/78TC56ARqlzkBoN/5CwH+Ojzscmt5BYn9Q+29wDYKC3qfn5FA+OCUl1Q3Svyz7A = X-Google-Smtp-Source: AGHT+IEIjuGeDSRa8BSUAmIRFNtQy168IOutQOYd2NeUrQwfwTQfRjUz9dOdxrPre87728UH145aBw== X-Received: by 2002:a17:906:8312:b0:a56:2556:8e3 with SMTP id j18-20020a170906831200b00a56255608e3mr1644105ejx.73.1714128472260; Fri, 26 Apr 2024 03:47:52 -0700 (PDT) Received: from ?IPV6:2a04:cec2:24:96a5:5270:2d0a:680d:857e? ([2a04:cec2:24:96a5:5270:2d0a:680d:857e]) by smtp.gmail.com with ESMTPSA id h26-20020a17090619da00b00a588729de82sm3606308ejd.142.2024.04.26.03.47.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 03:47:52 -0700 (PDT) Message-ID: <76cc558c-49bf-40f1-b28c-a62584f62e00@embecosm.com> Date: Fri, 26 Apr 2024 12:47:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: lh_mouse@126.com Cc: gcc@gcc.gnu.org References: <79bd7ab5-b908-400d-b0a6-1faf1193bc61@126.com> Subject: Re: [PATCH] Fix rust on *-w64-mingw32 Content-Language: en-US From: Arthur Cohen In-Reply-To: <79bd7ab5-b908-400d-b0a6-1faf1193bc61@126.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, Thanks a lot for the patch :) I agree with Jakub that we should be using the GNU coding style in our call to std::replace - this is what we try to enforce in the rest of the Rust frontend. Regarding the changes to `mkdir_wrapped`, the function now looks a bit odd: void mkdir_wrapped (const std::string &dirname) { int ret; ret = mkdir (dirname.c_str (), 0775); (void) ret; } could you change it to something simpler like simply ignoring the return value of `mkdir`? since this is what we are already doing (and we should improve error handling here... but one battle at a time). I would suggest the following: void mkdir_wrapped (const std::string &dirname) { mkdir (dirname.c_str (), 0775); } Have you run the testsuite on *-w64-mingw32? I'm wondering if commenting out the `register_callback` function causes any issues there? All in all I'm in favor of this patch, and thanks for submitting it :) Best, Arthur