Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002244graphvizOtherpublic2013-01-09 05:182013-01-09 05:18
ReporterJaroslav Skarvada 
Assigned To 
PlatformOSOS Version
Summary0002244: Please fix integer overflow in the code
DescriptionWhen compiled with recent enough gcc (I tried 4.7.2) with -O2 (as many distros already do) the -fstrict-overflow is in effect and the integer overflow in the code must be avoided, because it is undefined, compilation log:

> shortest.c:539:8: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
> ...
> graph_generator.c:156:3: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]

Steps To ReproduceCompile with -O2 (or -fstrict-overflow) with recent enough gcc (e.g. 4.7.2).
Additional InformationAs there are only two places in the code when this happen, it should be easily fixable. This should be fixed also for portability reason, because compilers other than gcc may handle the overflow its own way. I attached the patch that should fix the first case (maybe on the failed check the abort may be better than the return).

For the second case, I am not sure how to fix it the best way, but the solution should be similar.

More info:
gcc man -fstrict-overflow [^]

This also seems to happen with the latest graphviz development snapshot.
TagsNo tags attached.
Attached Filespatch file icon graphviz-2.8-growtris-no-overflow.patch [^] (1,181 bytes) 2013-01-09 05:18 [Show Content]

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2013-01-09 05:18 Jaroslav Skarvada New Issue
2013-01-09 05:18 Jaroslav Skarvada File Added: graphviz-2.8-growtris-no-overflow.patch

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker