Hello,

I can compile this code with gcc (-lm)
but not with clang
test.c:8:22: warning: implicit declaration of function 'CMPLX' is invalid in 
C99 [-Wimplicit-function-declaration]
  double complex z = CMPLX (1., 2.) ;
                     ^
1 warning generated.
/usr/bin/ld: /tmp/test-52cb2b.o: in function `main':
test.c:(.text+0x1b): undefined reference to `CMPLX'
clang-14: error: linker command failed with exit code 1 (use -v to see 
invocation)

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <complex.h>


int main () {
  double complex z = CMPLX (1., 2.) ;

  }


I could not find any option of clang which let me compile it without this error.


===========================================================================
 Patrick DUPRÉ                                 | | email: [email protected]
 Laboratoire interdisciplinaire Carnot de Bourgogne
 9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE
 Tel: +33 (0)380395988                    | | Room# D114A
===========================================================================
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue
  • clang Patrick Dupre

Reply via email to