This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][4.3] Deprecate -ftrapv


FX Coudert wrote:
In Fortran, integers are used to index arrays. So if you want integer overflow checking, use -fbounds-check :-)
I know there is a smiley here, but it seems to me that range checking
is quite different from overflow checking.

I think what Toon was alluding to is that "real" Fortran programmers don't use integers except for array subscripts. Real life is floating- point based!

Well as a one-time real Fortran programmer i would say that comes under the rubric of common misconception. Sure there are lots of fpt operations in Fortran code, but probably most Fortran programs have more integer arithmetic operations than fpt operations, and by no means all are about array indexing :-)

I can't remember if Knuth's empirical study of actual Fortran
code commented on this situation (that was the study that showed
that the average expression in Fortran has only a few terms,
unfortunately it is not available unless you pay $30 :-) on the web.

FX



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]