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.133.124]) by sourceware.org (Postfix) with ESMTPS id 57EE2385828E for ; Tue, 5 Jul 2022 09:16:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 57EE2385828E Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-246-DUyMGcLJMPublcrJNVdcpQ-1; Tue, 05 Jul 2022 05:16:28 -0400 X-MC-Unique: DUyMGcLJMPublcrJNVdcpQ-1 Received: by mail-qt1-f198.google.com with SMTP id ck12-20020a05622a230c00b00304ee787b02so7705677qtb.11 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=fq4BE4dXssXoA8vVsem9cxxwlBLc6/Hyqn55cQXH4b+p5SySUNCZLhuqE38YovDIl4 t1vyMDkLFDZhZoaKawOSlBB1PQwqef1z/QwLj6iGVnYqfp5tJCIGtG8fPf6J/znRJWDR A5AmqbuXdTNqtUZaTVF2p6sCk/urDjG9mHKflUMKyEhOssHLnFAakwYS7lp+j+He660E DdmJU3UfFBrS7EgBvoUCLCC5/xjCSRLXvMG2uBk8LuCIFFyM+mJC4mAgQSS1mAOgY8NM 7TEu/2T+jNlUFMY9g9yNo2cGC3/pPgofOpY/0IOPdD218B85jXkdtgA93BhsZIwth5/f y1qA== X-Gm-Message-State: AJIora/ABeo2Y8mG2J2gGldA5n7mlXaUw6SXdLbu1F+FHhddcA6jh8re AzSdkxyzaoMaHuI/HqypZ2kVeIoNuzmt7q5irHkRnwkQdKjRoiWnCecauaXcsyJ2AlmaPcEzetk oN5XUda9/nDAu4xN9+Yd0l5XkV9pNJTcI6w== X-Received: by 2002:ac8:7d92:0:b0:31e:7996:3745 with SMTP id c18-20020ac87d92000000b0031e79963745mr5951024qtd.491.1657012587640; 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=-6.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches 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.