DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2797
Version: 1.3-current


Great -- whatever we do, sounds like fl_create_offscreen()
is a possible culprit, and since it's a public (documented)
function, we should probably document the w|h == 0 issue.

Currently the docs don't mention a w/h of zero is bad,
or if NULL is a possible return value:
http://fltk.org/doc-1.3/group__fl__drawings.html#ga22259d434be43b30f74bfb3e96c5fdab

So I imagine one of the following should be changed in
fl_create_offscreen():

    1) Document current behavior to indicate w|h of zero causes
       "undefined behavior", make the change you show at line 338,
       and make sure we handle other_xid == NULL correctly.

    2) Change fl_create_offscreen()'s code to check for w|h == 0
       and return NULL, document that, and warn that in versions
       previous to 1.3.1 there was undefined behavior for w|h == 0.
       And then NOT make any change to line 338, and make sure
       we handle other_xid == NULL correctly.

    3) Allow a w|h of zero, and return a pointer to 'something'
       so that it doesn't crash, and document that w|h can be
       zero (but warn versions previous to 1.3.1 had undefined behavior)
       and check to make sure related offscreen functions won't crash
       when working with a zero sized offscreen buffer. And make no
       change to line 338, and make sure we handle other_xid == NULL
       correctly anyway (see below).

fl_create_offscreen() should probably return NULL if w|h is negative
and document that. (Not that that's an issue here, but it probably should)


Link: http://www.fltk.org/str.php?L2797
Version: 1.3-current

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to