[cairo-bugs] [Bug 83295] New: difference of non negative enums is never negative

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Aug 31 06:53:41 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=83295

          Priority: medium
            Bug ID: 83295
          Assignee: chris at chris-wilson.co.uk
           Summary: difference of non negative enums is never negative
        QA Contact: cairo-bugs at cairographics.org
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: sixtysix at inwind.it
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: general
           Product: cairo

Gcc treats enum with non negative values as unsigned,
so using the difference in a comparison function is
questionable:

http://cgit.freedesktop.org/cairo/tree/src/cairo-polygon-intersect.c#n794

for example adding a 

assert (a->type - b->type >= 0);

gcc prints

src/cairo-polygon-intersect.c|795 col 15| warning: comparison of unsigned
expression >= 0 is always true [-Wtype-limits]
      assert (a->type - b->type >= 0);

this means that three events (START, STOP, INTERSECTION) in the same
place will be potentially each one after each other, making difficult
to understand whether equally located STOP/INTER/START events should be
really processed in that order or not.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20140831/a72a88b5/attachment.html>


More information about the cairo-bugs mailing list