Seemingly impossible to implement GtkWidget::measure without getting warnings from valac
@baedert
Submitted by Timm Bäder Link to original bug (#782865)
Description
The signature from gtkwidget.c:
void (* measure) (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
int *natural_baseline);
The semantics are that all of the last 4 arguments are (out), but they do not have to be set.
Problem 1: Even if the implementation specifies an explicit default value for e.g.the out int minimum argument, valac still warns that the implementation didn't assign any value to it, which is perfectly fine from a C perspective.
Problem 2: gtk+ warns (should warn, will warn, select one. it does not right now but it will in the future I think) when the passed orientation is GTK_ORIENTATION_HORIZONTAL and a value other than -1 is assigned to the 2 _baseline arguments (implementations should just not assign anything in that case). These are runtime warnings because valac generates an assignment to 0.