20 ms·
On array convenience: Fortran also supports optional runtime bounds checking of array indexes. I've worked writing signal processing code in Fortran, and it's r
by angrygoat 9y ago
On array convenience: Fortran also supports optional runtime bounds checking of array indexes. I've worked writing signal processing code in Fortran, and it's really quite nice to have that when doing dev, even if you turn it off in prod for performance reasons.
- gravypod 9y agoGCC/G++ will remove bounds checking on O3 I think.
- lvh 9y agoGP is saying the contrapositive for Fortran: you can have runtime bounds checks during development instead of disabling them for production builds. I'm not sure which feature you're referring to, because while GCC has -fbounds-check, that's for the GNU Compiler Collection and only for frontends that support it (to wit, Fortran and Java). I don't know of any runtime bounds checking that ever made it into vanilla. Clang and GCC both have some limited array bounds checking, but it's static, and there are plenty of issues it won't catch. People maintained third party patches for a long time, but these are obsolete now. Perhaps you're thinking of ASAN/-fstack-protector-*?
- pletnes 9y agoIt’s a separate flag, independent of optimization, on all Fortran compilers I’ve used AFAIR (nag, intel, pgi, gfortran).