From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) by sourceware.org (Postfix) with ESMTPS id 1A7F63858C83 for ; Thu, 3 Nov 2022 14:13:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A7F63858C83 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-f171.google.com with SMTP id k26so1185535qkg.2 for ; Thu, 03 Nov 2022 07:13:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/rZM3hzx0zvUc+5BjfvpPrDfPJKzZD/0Njf4UajH9Bw=; b=54xp5VcCY/wC72Ic/dF4XauO91gtocLKJ6o/YkUpQ8XSatq4wS1xtbwdIyu5TKKzb4 kBFQbumgVZszhlcgXrlV3+fNwqyjAjekVJc1sx+GOUnDZ/x66tvgnvu6NA0uF5Lj6Ooo TLWZ5aolrclWu5zCkiIlGgT8o0Pherb6G4+4aJh9NPxlADwB68M0X57WL+g9IOJskyNF nVQcr3F2kpvqjsB8E/M3JIZ8aA3ExVbHiP2UPfXM9Bfa67REJ6Cm6TBMzzp8iEH7tOIu P8RZYJ5Rv8rQR4m90wPaSRMeM71AuMU7gfr5DiYahBdZ6RaYT8Iu0QgZgMSo84kN6f4G EWUA== X-Gm-Message-State: ACrzQf1YwbJVzXueTN5Fr9hCy69hm6ZWWaTZ8I5m08VSF4Ztknuk1J8L cWQ77DKDrD0LQtpI8SP2KcVmcTCVVkc= X-Google-Smtp-Source: AMsMyM4ih2Kc27gDv13oafwRb8oMhusf/X+uh7QWkoZSYo0/NASpVuR1MDcH/x3MeplPkzldxueDuw== X-Received: by 2002:a37:c205:0:b0:6fa:18aa:c514 with SMTP id i5-20020a37c205000000b006fa18aac514mr20139017qkm.549.1667484806201; Thu, 03 Nov 2022 07:13:26 -0700 (PDT) Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com. [209.85.128.182]) by smtp.gmail.com with ESMTPSA id ay30-20020a05620a179e00b006c479acd82fsm852227qkb.7.2022.11.03.07.13.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Nov 2022 07:13:26 -0700 (PDT) Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-3321c2a8d4cso16354397b3.5 for ; Thu, 03 Nov 2022 07:13:25 -0700 (PDT) X-Received: by 2002:a0d:eb88:0:b0:367:284a:a4a with SMTP id u130-20020a0deb88000000b00367284a0a4amr27719751ywe.282.1667484804700; Thu, 03 Nov 2022 07:13:24 -0700 (PDT) MIME-Version: 1.0 Reply-To: joel@rtems.org From: Joel Sherrill Date: Thu, 3 Nov 2022 09:13:12 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: round() on arm vs aarch64 To: Newlib Content-Type: multipart/alternative; boundary="00000000000073e19c05ec918f6e" X-Spam-Status: No, score=-3031.6 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,KAM_DMARC_STATUS,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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: --00000000000073e19c05ec918f6e Content-Type: text/plain; charset="UTF-8" Hi This is likely not a newlib bug but I thought I would start here because I'm not sure what is going on and I thought someone on this list would have an idea: This is a simple C++ function that calls std::round. It compiles on arm but aarch64 says round isn't in the std namespace. If you change the program to just use round() and not std::round() it compiles on both architectures. The compiler versions are the same and report: arm-rtems6-gcc (GCC) 12.2.1 20221014 (RTEMS 6, RSB cb8821e93378118e78a9cb25859789b126bd5761, Newlib 0b6342c) ===================== $ cat r.cc #include int wrap(double v) { double r = std::round((float)v); return (r > 0); } [joel@devel round]$ arm-rtems6-gcc -Wall -c r.cc [joel@devel round]$ aarch64-rtems6-gcc -Wall -c r.cc r.cc: In function 'int wrap(double)': r.cc:5:19: error: 'round' is not a member of 'std'; did you mean 'round'? 5 | double r = std::round((float)v); | ^~~~~ In file included from /home/joel/rtems-work/tools/6/lib/gcc/aarch64-rtems6/12.2.1/include/c++/cmath:45, from r.cc:1: /home/joel/rtems-work/tools/6/aarch64-rtems6/include/math.h:337:15: note: 'round' declared here 337 | extern double round (double); ===================== Any ideas what would cause this? Thanks --joel --00000000000073e19c05ec918f6e--