GNOME Bugzilla – Bug 744590
silence -Waggregate-return warnings
Last modified: 2015-03-27 06:10:45 UTC
In gnome-photos, the warning is triggered by gegl_node_get_bounding_box which returns a GeglRectangle structure. Better to turn off this warning for this specific piece of code ?
Created attachment 296938 [details] [review] gegl-gtk-view-helper: Silence -Waggregate-return gegl_node_get_bounding_box returns a structure, GeglRectangle which is the cause of warning. We write a wrapper function over it with an out parameter and silence the warning emitted by gegl_node_get_bounding_box with the help of diagnostic pragmas.
Created attachment 296939 [details] [review] base-item: Silence -Waggregate-return
Review of attachment 296939 [details] [review]: Thanks, Pranav. Looks good.
Review of attachment 296938 [details] [review]: ::: src/gegl-gtk-view-helper.h @@ +86,3 @@ GeglGtkViewAutoscale view_helper_get_autoscale_policy(ViewHelper *self); +void view_helper_get_bounding_box(GeglNode *node, GeglRectangle *bbox); It is better to put it in photos-utils since it is used from multiple places. It looks strange to include a file that is an implementation detail of the view widget (*) in photos-base-item just to silence a warning. (*) The ViewHelper class is an implementation detail of GeglGtkView. See https://git.gnome.org/browse/gegl-gtk
Comment on attachment 296939 [details] [review] base-item: Silence -Waggregate-return Attachment 296939 [details] pushed as 9cd3307 - base-item: Silence -Waggregate-return
Created attachment 297095 [details] [review] Silence -Waggregate-return gegl_node_get_bounding_box returns a structure, GeglRectangle which is the cause of warning. We write a wrapper function over it with an out parameter and silence the warning emitted by gegl_node_get_bounding_box with the help of diagnostic pragmas.
Review of attachment 297095 [details] [review]: -Waggregate-return has been dropped from the latest macros, so we don't need to do this any more.