What does it have to do with the compiler?
What does it have to do with the compiler?
Posted Jun 21, 2019 9:46 UTC (Fri) by NAR (subscriber, #1313)Parent article: C, Fortran, and single-character strings
I don't quite get what this bug has to do with the compiler. I mean it's like a function that has a "flags" arguments which previously only was using the lowest 2 bits, but now it starts to use the 3rd bit and suddenly all calls are broken that previously set the 3rd bit... Also it doesn't seem that hard to fix the callers with a sed command.
The other thing I don't get: it's C calling FORTRAN, so I'd guess there are C header files generated from the FORTRAN code that contain the prototype of the public functions and those should have the length parameter, shouldn't they?
Posted Jun 21, 2019 10:32 UTC (Fri)
by bjartur (guest, #67801)
[Link]
Posted Jun 21, 2019 13:42 UTC (Fri)
by mathstuf (subscriber, #69389)
[Link]
Maybe for BLAS/LAPACK, but this isn't how it works in general since most Fortran code used directly from C happens within the same project. There's usually some configure-time logic to determine the mangling strategy of the in-use Fortran compiler. This then guides a macro selection around the core symbol names in a header which has the `extern` declarations of those functions with the right mangling. I suspect that the length arguments are visible in those C declarations, but not in the actual Fortran code.
Posted Jun 21, 2019 19:10 UTC (Fri)
by joib (subscriber, #8541)
[Link]
They have C prototypes for the Fortran functions, but they are presumably hand-written and they have omitted the length parameter. Which is the reason behind this entire mess.
What does it have to do with the compiler?
What does it have to do with the compiler?
What does it have to do with the compiler?