From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 707B83857C50; Fri, 10 Dec 2021 15:42:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 707B83857C50 Received: by mail-wr1-x42f.google.com with SMTP id d24so15724793wra.0; Fri, 10 Dec 2021 07:42:58 -0800 (PST) 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=qVsJyqnKIsou69wI9fWPlF2XfGlycg14xhRvpSy5US0=; b=RwTlsS5JuOFHFQkVfJHB/V8VskZntXnBMDRSVpcCG9uN/DfiFQbtOUVAz1+Qs3qvWH JVo1nKaPvRHK7O+bq+3mxUItKdeeOtyfSbH/3Ozvzd1kg+9pNAt/6LJq5BZXDypPEOjR uhbO3qpjOq//5Ki/2dDBXlr7WbzjXzTVicc6yfsC6Ojvvf3eRkzLigcKIWGjzgcZFhdO Lmtm1GGonS6siYmL59w07GTzbUjHbY2+0N4TxRXDsttbFOhKOeEBEkS7KWGaIdbUEqet +G4O1l1H+8TCUfi5LCqgGp+LpFNy/ZeewfVYYDZWFc9YGTYjOSY6WTthAlu2DKi2Qfcc UgFg== X-Gm-Message-State: AOAM533dMLoABWvPmQwySxopZlxple7KEqObJi/pIsSNEq+G8FcKhwzb nJIHzmWqFV06uke5X/wcyC1g83UC8zqMEQS4YpQ= X-Google-Smtp-Source: ABdhPJyaxQgEBcsMTUiOtTdLh7zUqaWUeSypnT2X7YktE2Kyz9PEGDxtiWWXGzBWhN/5eY3C4WxKJT+Vc5qZRiERsb8= X-Received: by 2002:a5d:6085:: with SMTP id w5mr15176486wrt.122.1639150977528; Fri, 10 Dec 2021 07:42:57 -0800 (PST) MIME-Version: 1.0 References: <3a28a096-3aec-7270-5e7b-9b8a54e4c7b9@prevas.dk> In-Reply-To: <3a28a096-3aec-7270-5e7b-9b8a54e4c7b9@prevas.dk> From: Jonathan Wakely Date: Fri, 10 Dec 2021 15:42:46 +0000 Message-ID: Subject: Re: [PATCH] Define _C99 in libstdc++ vxworks/os_defines.h To: Rasmus Villemoes Cc: Olivier Hainque , "libstdc++" , gcc-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 10 Dec 2021 15:43:00 -0000 On Fri, 10 Dec 2021 at 15:16, Rasmus Villemoes via Libstdc++ wrote: > > On 10/12/2021 16.06, Olivier Hainque wrote: > > Hello, > > > > The attached patch for libstdc++ / VxWorks helps building > > the library for old versions of the OS, as witnessed with > > VxWorks 6.9 in particular. > > > > It explicitly requests C99 features from old system headers, > > on which libstc++ relies since at least c++98. The specific > > issue that exposed this was a failure to compile > > > > libstdc++-v3/src/c++17/floating_to_chars.cc > > > > for VxWorks 6.9 with a batch of errors such as: > > > > error: 'FP_NAN' was not declared in this scope > > > > The missing definitions are provided by the > > system headers with guards on _HAS_C9X, which gets > > internally defined when _C99 is. > > > > Ok to commit? > > Yes, we've observed that error as well. We have just patched our vxworks > 5.5 headers to provide FP_NAN et al. There's no test of definedness or > other uses of a _C99 macro anywhere, so ok by me, as it shouldn't change > anything on our end. > > Rasmus OK to commit then, thanks. The comment is a bit misleading though: +// libstdc++ relies on C99 features for virtually all versions of C++, +// up to at least C++98. +#undef _C99 +#define _C99 1 The "up to" seems backwards, I'd expect it to say "down to" or "as far back as at least C++98". But there's nothing older than C++98 anyway, so this just means "all versions", there's no "virtually" about it. Please just say "libstdc++ relies on C99 features for all versions of C++".