On 05/12/2015 01:22 PM, Alan W. Irwin wrote: > On 2015-05-12 09:41-0400 Hazen Babcock wrote: >> >> Hm.. example 21 also generates an FPE, but at least in this case it >> looks like it is coming from the qhull library. And example 29 also >> generates an FPE, but only the Fortran version not the C version. So, >> maybe it would be better in the end to add this check to all of the C >> examples as well? > > I sympathize with your desire not to mark up all the examples. Which > lead to the thought that if gfortran has an option to report the above > exceptions without additional code markup, then gcc might have such > options as well. > > A google search on the terms <gcc floating point exception traps> > found somehow else had asked that exact question at > <http://stackoverflow.com/questions/18644168/catch-floating-point-exceptions-using-a-compiler-option-with-c> > > I don't understand the answers myself, but perhaps they might be useful > to you.
I found this as well, which is what led me to the gfortran flag. They are saying that such a flag does not currently exist for C. > If it turns out the answer is currently "no" (i.e., you must mark up > the examples in order to detect floating-point exceptions with gcc), > then I think we could probably just stick with gfortran and > -ffpe-trap=invalid,zero,overflow,underflow. > > Of course, the fortran examples go through a lot of additional code > before finally calling our core C library so this method should detect > floating-point exceptions in the fortran example implementation, the > fortran wrapper library code, AND, our core C library. So we do want > to solve all of those. Furthermore, once we have done so then I > believe the only C floating-point exception left that would go > undetected would be in the actual C example implementation, i.e., if > we divided by 0. right in one of the examples. But we guard against > such issues in other ways (with the comparisons of PostScript and SVG > results) so I don't think we need to be concerned about such an issue. > > If you agree with my above reasoning that gfortran with > -ffpe-trap=invalid,zero,overflow,underflow is what we want to do going > forward to detect floating point exceptions, then I hope you have the > time to fix all the causes of those exceptions in this release cycle. I'd add it to the debug build flags for fortran. Perhaps a check is also needed that the fortran compiler is gfortran? -Hazen ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel