Skip to content
Commit e2961c11 authored by Emmanuele Bassi's avatar Emmanuele Bassi 👣
Browse files

Add G_GNUC_WARN_UNUSED_RESULT annotation to init functions

This has started to be a problem; applications using clutter-gtk just
assume that clutter-gtk will abort() if the initialization does not
succeed, just like gtk+ does. Clutter, on the other hand, has a non
fatal init - it'll return an error code for you to trap. This is more
of an historical accident, but we cannot change the semantics now. If
Clutter fails to initialize, any subsequent call to Clutter or Cogl
functions will have undefined results - most likely they'll end up in
a segfault somewhere down the line, but all bets are off.

Clutter started annotating its init functions to generate a compile
time warning if the return value is not being assigned; clutter-gtk
ought to do the same, to avoid mystery segfault bugs being filed.
parent bd5bddc0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment