After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744590 - silence -Waggregate-return warnings
silence -Waggregate-return warnings
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.15.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-02-16 13:55 UTC by Pranav Kant
Modified: 2015-03-27 06:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gegl-gtk-view-helper: Silence -Waggregate-return (7.51 KB, patch)
2015-02-16 15:12 UTC, Pranav Kant
needs-work Details | Review
base-item: Silence -Waggregate-return (1.41 KB, patch)
2015-02-16 15:12 UTC, Pranav Kant
committed Details | Review
Silence -Waggregate-return (7.62 KB, patch)
2015-02-18 14:37 UTC, Pranav Kant
rejected Details | Review

Description Pranav Kant 2015-02-16 13:55:43 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 ?
Comment 1 Pranav Kant 2015-02-16 15:12:39 UTC
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.
Comment 2 Pranav Kant 2015-02-16 15:12:45 UTC
Created attachment 296939 [details] [review]
base-item: Silence -Waggregate-return
Comment 3 Debarshi Ray 2015-02-18 10:32:17 UTC
Review of attachment 296939 [details] [review]:

Thanks, Pranav. Looks good.
Comment 4 Debarshi Ray 2015-02-18 10:40:00 UTC
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 5 Pranav Kant 2015-02-18 10:53:04 UTC
Comment on attachment 296939 [details] [review]
base-item: Silence -Waggregate-return

Attachment 296939 [details] pushed as 9cd3307 - base-item: Silence -Waggregate-return
Comment 6 Pranav Kant 2015-02-18 14:37:13 UTC
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.
Comment 7 Debarshi Ray 2015-03-27 06:10:29 UTC
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.