How to fix the errors in compiling ODEPACK in debug mode?

I would add that in addition to not detecting such games-errors, developers got used to compilers implementing this extension-to-the-standard in the same way (always pass the address of the object and always assume that an address has been passed and hope for the best). And that’s how we ended up with compiled executables that changed the value of constants, like 2.

Just write Fortran. And if the hack you want is not doable, pass it to C and try it there.

You are NOT allowed to associate (i.e., pass) arrays to dummy scalars. Cure: index the array so that you associate one element. That element will be potentially modified.

You are NOT allowed to associate scalars to dummy arrays. Cure: find out how big the array must be and construct one, and pass it. Then figure out what the developer intended to happen to the scalar, probably update it with the first element of the returned array.

You ARE allowed to associate an array element with a dummy assumed-size (or explicit shape) array. That is “sequence association”. But you better make sure that there are enough subsequent elements after the array element you passed, as they will potentially be modified.

You ARE allowed to use the newer assumed-rank or assumed-type features of the language.

1 Like