On Aug 29, 2022, at 11:18, Patrick Dupre <[email protected]> wrote:
> 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.

You might want to check out this bugzilla BZ, it describes the problem and why 
it happens. 

https://sourceware.org/bugzilla/show_bug.cgi?id=26287

--
Jonathan Billings
_______________________________________________
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
    • Re: clang Jonathan Billings
    • clang Patrick Dupre
      • clang Stephen J. Turnbull

Reply via email to