From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by sourceware.org (Postfix) with ESMTPS id 3FB553959C89 for ; Tue, 10 May 2022 15:49:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3FB553959C89 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-lj1-f175.google.com with SMTP id bx33so10488146ljb.12 for ; Tue, 10 May 2022 08:49:31 -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:reply-to :from:date:message-id:subject:to:cc; bh=kbL67uPIM7VHLNXov0aA6tIlcOd14hUjBba4L9OiCA0=; b=7NYMyGXqMRuj6S37mokCDLmoDEBVBHyNcbzHC1N/yBa3sUBDUzo/Uf4hhVvNvOa2Px Q3fcHNa6qvkWLshd5Qxc7L5SYLZ3VRTGtGjkxlAnrBxCuHtlHON0VH+ECFqKdERfVf+t qMvq7yhaHwV+ll8STxwpphSNPhNnPMCujHCdyO3jZ81+l4VsvinsMPwwXQCaUnyQ9rul 7ajQF2y6ubpmDxiQaWhQW+mx2hzm4iJ3pReb5WrUuRiNpHYP6r4iFazQneM8cg0OcwOu dDCPFNtZw7WQtj+3rr+hB4j3l7ROfe0pXhsEizWI/seR+CcaQoNn2MQbmZagWT+jwIhG cr+Q== X-Gm-Message-State: AOAM530YJ7hvprn3nLZD3BDlXhoPANoLZT2x7mz/RRvTB7C9RDIVh9x1 zPQ1ow7H20XEr09jM0jdnhSPQpZ7LEg9Pw== X-Google-Smtp-Source: ABdhPJz3wNKZ3nZxpBYXruuPgmHpWOvvEI5zdLNql1rrphn6B0ZIO2oAquPO5PtLk6fV8bmiUM6OBQ== X-Received: by 2002:a2e:8917:0:b0:24f:3bb6:b399 with SMTP id d23-20020a2e8917000000b0024f3bb6b399mr14635636lji.246.1652197769464; Tue, 10 May 2022 08:49:29 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id l24-20020a056512333800b0047408564c31sm1539156lfe.286.2022.05.10.08.49.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 May 2022 08:49:29 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id 4so21348666ljw.11 for ; Tue, 10 May 2022 08:49:29 -0700 (PDT) X-Received: by 2002:a2e:82cd:0:b0:24b:4a69:790b with SMTP id n13-20020a2e82cd000000b0024b4a69790bmr14359186ljh.326.1652197768898; Tue, 10 May 2022 08:49:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: joel@rtems.org From: Joel Sherrill Date: Tue, 10 May 2022 10:49:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Issue: CMPLX is not defined To: Pavel M Cc: Newlib 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, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 15:49:32 -0000 On Tue, May 10, 2022 at 10:40 AM Pavel M wrote: > Hi all, > > Issue: CMPLX is not defined. > > $ cat t649.c > #if __STDC_NO_COMPLEX__ != 1 > #include > #ifndef CMPLX > #error > #endif > #endif > > $ gcc t649.c -std=c11 -pedantic -Wall -Wextra > t649.c:4:2: error: #error > 4 | #error > | ^~~~~ > > C11: > > 7.3.9.3 The CMPLX macros > > Please fix. > If you really need these, they are simple to implement and patches are always welcomed. This is the entirety of the implementation for glibc: #if defined __USE_ISOC11 && __GNUC_PREREQ (4, 7) /* Macros to expand into expression of specified complex type. */ # define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y)) # define CMPLXF(x, y) __builtin_complex ((float) (x), (float) (y)) # ifndef __NO_LONG_DOUBLE_MATH # define CMPLXL(x, y) __builtin_complex ((long double) (x), (long double) (y)) # endif #endif Should be a simple patch to complex.h --joel