3 ms·
ISO C specifies no requirements for interacting with Fortran. Every aspect of this is "C undefined behavior". Requirements are violated, to be sure, but not on
by kazinator 7y ago
ISO C specifies no requirements for interacting with Fortran. Every aspect of this is "C undefined behavior". Requirements are violated, to be sure, but not ones coming from ISO C.
- uxp100 7y agoThat doesn't sound like undefined behavior to me. Or at least a different definition than the normal one.
- kazinator 7y ago"C undefined behavior" is the status of the behavior of a C program for which a requirement cannot be found in ISO C by omission, or for which ISO C explicitly says that it's not giving a requirement. No requirement can be found in ISO C for linkage with Fortran. There is another "undefined behavior" which is the informal situation that happens when a behavior is not defined by anyone at all: not ISO C, not the platform's ABI or API's, not the compiler reference manual. (That is hard to pin down, because what does it mean? If I compile a program, it's always defined by whatever the object code is doing. We can interpret the instructions through the architecture reference manual, and if we don't find a problem then, hey, it's defined! (However, the compiler's documentation doesn't guarantee the consistency of always producing that particular compiler output for that program.) In any case, that Bugzilla comment specifically said "C undefined behavior".