mjklemm wrote:

Here's the reproducer on my system:

```
[2023-12-01 18:36:31 CET] iris ~/tm*/fo*/ftn_main_dupes [0:0] (main *=)> 
gfortran -o ftn.o -c ftn.f90 && gcc -o prg.o -c prg.c && gfortran -o ./bla 
ftn.o prg.o
/usr/bin/ld: prg.o: in function `main':
prg.c:(.text+0x0): multiple definition of `main'; ftn.o:ftn.f90:(.text+0x8f): 
first defined here
collect2: error: ld returned 1 exit status
[2023-12-01 18:36:34 CET] [1] iris ~/tm*/fo*/ftn_main_dupes [0:0] (main *=)> 
cat prg.c
#include <stdio.h>

int main(int argc, char * argv[]) {
    printf("Hello from C [%s]\n", __FUNCTION__);
    return 0;
}
[2023-12-01 18:36:37 CET] iris ~/tm*/fo*/ftn_main_dupes [0:0] (main *=)> cat 
ftn.f90
program ftn
    print '(A)', 'Hello from Fortran'
end program ftn
[2023-12-01 18:36:40 CET] iris ~/tm*/fo*/ftn_main_dupes [0:0] (main *=)> 
gfortran --version
GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

https://github.com/llvm/llvm-project/pull/73124
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to