From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 704A23858292 for ; Tue, 5 Jul 2022 09:16:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 704A23858292 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-263-ty6DPm80PguQZfblOIprqQ-1; Tue, 05 Jul 2022 05:16:28 -0400 X-MC-Unique: ty6DPm80PguQZfblOIprqQ-1 Received: by mail-qk1-f200.google.com with SMTP id w16-20020a376210000000b006af059b17b7so10852596qkb.12 for ; Tue, 05 Jul 2022 02:16:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SCcGbRT4sOOqE3AjlztVpeMWpIB5C6k3nadbDrgzOQk=; b=O1yX8xgNUSia3zLHbE54djCVljdPeVJSrQKyAwNsDypNdWfgGkJ+NoBP/Z5O9LmvY7 gQiJ6yfE548AhnDruGwNXSGBJqwXxiLb1ZcmPtIcUrf29mXKH1mrBceEZkAF2KePSlj9 99jUpsDTLaT/2R7dAqzAc7c0q6Pm91uBuHW/9HFivh4Uus6Yuljrz+n+eqmUY/HPTjdD n86bpSqHolsS1uACzoaM/wJltQvKeg2f2O3YAQ0WO+eTqe+Wuts4fNtiNzocrb48H64v ++DSQHvSgDt4W2f6+4EiFwvRj7POb8ukhKJms8kYlx9AROPBexvY+uQuP/p/ppv4+bTX LLrA== X-Gm-Message-State: AJIora/o6ZYJRj+2CcHtyfedfz1q1JpQY8yNc8jc+n519FhrDEORnGrc B6LFOQb9Gw0ChovgowrfZkc+jalWOvp4VbvVVPW6ZYtVYzcva8rHLew9l8VcDYPzCgnDCJTrk3t mwo2UEV36OwxqZ78tF+bjvKX4SAYU+6U= X-Received: by 2002:ac8:7d92:0:b0:31e:7996:3745 with SMTP id c18-20020ac87d92000000b0031e79963745mr5951026qtd.491.1657012587655; Tue, 05 Jul 2022 02:16:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uAEss/9+tKASKjyZXNF/KnY47llQn7o5PR1Yi/XEotTx1ZY9EJBGUuOu/Kj6KH7lOIVSwrbV6m3ihIpuOXmYs= X-Received: by 2002:ac8:7d92:0:b0:31e:7996:3745 with SMTP id c18-20020ac87d92000000b0031e79963745mr5951004qtd.491.1657012587437; Tue, 05 Jul 2022 02:16:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 5 Jul 2022 10:16:16 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp To: Alexandre Oliva Cc: "libstdc++" , gcc Patches , Joel Brobecker X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2022 09:16:30 -0000 On Tue, 5 Jul 2022 at 10:10, Alexandre Oliva via Libstdc++ wrote: > > On Jun 27, 2022, Alexandre Oliva wrote: > > > On Jun 23, 2022, Jonathan Wakely wrote: > >> The attached makes this a bit more efficient, and makes more of the > >> code common to the mkstemp and non-mkstmp branches. I'll wait to hear > >> back from you before pushing it (since it has Joel's name on the > >> patch). > > > Thanks, I've given it a spin, both trunk and gcc-11, and I confirm it > > works for us. > > The bad news is that it broke on some other systems I didn't test back > then. It turns out the type cast for the ::getpid result was not just > because it was passed to printf before :-/ Ah, whoops. I did check that POSIX requires pid_t to be a signed integer type, but that doesn't mean it's always true for all GCC targets. > > > libstdc++: testsuite: cast getpid result > > On vxworks, in kernel mode, getpid's return type is a pointer type, so > std::to_string on it fails overload resolution. Restore the type cast > from the original patch that suggested adding the pid. > > Regstrapped on x86_64-linux-gnu, also tested on aarch64-rtems6.0 and > ppc64-vx7r2. I'm going ahead and checking this in as obvious. Please > let me know if you'd prefer this to be fixed in a different way. The cast itself is fine, but I'd like a comment like "N.B. pid_t is a pointer on vxworks" so I don't "simplify" it again. Thanks.