On Mon, Jan 28, 2013 at 08:47:14PM -0700, Orion Poplawski wrote: > On 01/28/2013 07:54 PM, Alan W. Irwin wrote: > > On 2013-01-28 17:01-0700 Orion Poplawski wrote: > > > >> Fedora rawhide has moved to gcc 3.8 and I'm seeing: > >> > >> $ ./x02a -dev psc -o x02a.psc > >> > >> raised CONSTRAINT_ERROR : x02a.adb:138 overflow check failed > >> > >> I'm taking that this is due to some increased checking with ada in > >> 3.8. Thoughts? > > > > Hi Orion: > > > > I am virtually positive you meant the gcc-4.8 development effort which > > (as far as I can tell) has not had a single release yet. So I am > > changing the subject line accordingly. But please confirm that is > > what you meant. > > > > If you meant gcc-4.8, there is always the chance that the symptom you > > are seeing is a general problem caused by some recently introduced > > version incompatibilty between gcc and Ada that still needs to be > > worked out, i.e., a compiler inconsistency issue that has nothing to > > do with PLplot development. On the other hand, it might be a PLplot > > Ada issue that has been detected by (presumably) better error checking > > for the latest versions of gcc/Ada as you have suggested. To help > > decide between those two possibilities, could you give more details? > > > > For example, if you use the make -k option (to keep going despite > > errors) are you able to compile all the Ada examples other than the > > second one? If the issue is confined to just one of our examples, then > > it is much more likely a PLplot Ada issue with that example (or the > > API tested with that example) as you have suggested. > > Sorry, yes it is 4.8. Fedora is very tight with gcc development so we > get things early - fun! > > The example compiles fine, it just doesn't run. Some others don't run > either (see below). > > It looks very much like a floating point overflow condition is being > triggered. With a debug statement it aborts at the start of the loop: > > i = 0 r1 = 3.00000000000000E-01 > > I suspect that: > > 138 r(i+16) := Integer((r1 * 255.001) - 0.499999999999999); > > Has too many digits to be properly expressed. The comments indicate > that it is dealing with some rounding/truncating differences. I suspect > that gcc in 4.8 traps these conditions by default. > > Others: > > raised CONSTRAINT_ERROR : x02a.adb:141 overflow check failed > raised CONSTRAINT_ERROR : x03a.adb:92 overflow check failed > raised CONSTRAINT_ERROR : plplot_thin.adb:179 overflow check failed > raised CONSTRAINT_ERROR : x12a.adb:105 overflow check failed > raised CONSTRAINT_ERROR : x13a.adb:73 overflow check failed > raised CONSTRAINT_ERROR : x14a.adb:218 overflow check failed > raised CONSTRAINT_ERROR : plplot_thin.adb:179 overflow check failed > raised CONSTRAINT_ERROR : x18a.adb:156 overflow check failed > raised CONSTRAINT_ERROR : x19a.adb:192 overflow check failed > raised CONSTRAINT_ERROR : plplot_thin.adb:241 overflow check failed > raised CONSTRAINT_ERROR : plplot_auxiliary.adb:40 overflow check failed > raised CONSTRAINT_ERROR : xthick02a.adb:136 overflow check failed > raised CONSTRAINT_ERROR : xthick03a.adb:92 overflow check failed > raised CONSTRAINT_ERROR : xthick12a.adb:104 overflow check failed > raised CONSTRAINT_ERROR : xthick13a.adb:73 overflow check failed > raised CONSTRAINT_ERROR : xthick14a.adb:218 overflow check failed > raised CONSTRAINT_ERROR : xthick18a.adb:155 overflow check failed > raised CONSTRAINT_ERROR : xthick19a.adb:192 overflow check failed
Urgh! Messing with float / integer values like this is just asking for overflow / rounding problems. What's wrong with using something like r(i+16) := Integer(Float'Floor(r1 * 255.001)); (N.B. I've not tried this but I think it should work) Andrew ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel