[Cfp-interest 3278] Re: Specification of complex operators

Paul Zimmermann Paul.Zimmermann at inria.fr
Mon Sep 16 01:24:04 PDT 2024


       Hi Damian,

> Lots of C compilers have broken CMPLX() macros. But have a working I.

indeed, clang 16.0.6 does not support CMPLX:

$ cat e.c
#include <stdio.h>
#include <complex.h>

int main()
{
  double complex z = CMPLX(1.0, 2.0);
  printf ("(%la,%la)\n", creal (z), cimag (z));
}

$ clang e.c
e.c:6:22: error: call to undeclared function 'CMPLX'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  double complex z = CMPLX(1.0, 2.0);
                     ^
1 error generated.

Paul


More information about the Cfp-interest mailing list