Re: GCC warning: correct?
Guillermo Rodriguez <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CABDcavYGuNejx6vKXBOy+9HpTdza-x37wyyLTirmv5jZOmq_MA@mail.gmail.com> |
2017-06-25 21:10 GMT+02:00 David Kastrup <[email protected]>: > David Kastrup <[email protected]> writes: > >> cairo-surface.c: In function ‘cairo_surface_create_similar’: >> cairo-surface.c:508:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] >> if (unlikely (! CAIRO_CONTENT_VALID (content))) >> ^~ >> cairo-surface.c:511:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ >> if (unlikely (other->status)) >> ^~ Looking at the sources this seems to be just a (cosmetic) indentation issue, no actual problems there. However the whole check in cairo-surface.c:511 is redundant, as exactly the same check has been done a few lines before (cairo-surface.c:501). I think the second one can just be removed. >> >> > > And another one? > > cairo-script-operators.c: In function ‘_set_dash’: > cairo-script-operators.c:4813:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] > if (_csi_unlikely ((unsigned) array->stack.len >= INT_MAX / sizeof (double))) > ^~ > cairo-script-operators.c:4815:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ > dashes = _csi_alloc (ctx, sizeof (double) * array->stack.len); > ^~~~~~ Also looks like a cosmetic indentation issue, no actual problems. The fixes for both are trivial, I am submitting them separately. Guillermo Rodriguez -- cairo mailing list [email protected] https://lists.cairographics.org/mailman/listinfo/cairo