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 770555 - Tagged entry GResources fixes
Tagged entry GResources fixes
Status: RESOLVED FIXED
Product: libgd
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: libgd maintainer(s)
libgd maintainer(s)
Depends on:
Blocks: 770121
 
 
Reported: 2016-08-29 13:53 UTC by Bastien Nocera
Modified: 2016-09-05 11:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tagged-entry: Fix missing GResource in test application (1.26 KB, patch)
2016-08-29 13:53 UTC, Bastien Nocera
reviewed Details | Review
build: Force creation of the resource .h file (1.40 KB, patch)
2016-08-29 13:53 UTC, Bastien Nocera
committed Details | Review
tagged-entry: Fix missing GResource when using static library (1.18 KB, patch)
2016-08-30 09:20 UTC, Bastien Nocera
none Details | Review
tagged-entry: Fix missing GResource when using static library (1.23 KB, patch)
2016-08-30 10:22 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2016-08-29 13:53:25 UTC
Those should help fix problems with the resource not being available.
Comment 1 Bastien Nocera 2016-08-29 13:53:29 UTC
Created attachment 334368 [details] [review]
tagged-entry: Fix missing GResource in test application

gcc seems to be stripping away the "unused"
gd_tagged_entry_get_resource() when linking it. Call the function to
avoid the function being stripped away.

See https://bugzilla.gnome.org/show_bug.cgi?id=770121
Comment 2 Bastien Nocera 2016-08-29 13:53:35 UTC
Created attachment 334369 [details] [review]
build: Force creation of the resource .h file

Otherwise automake will skip it as it is not included anywhere.

See https://bugzilla.gnome.org/show_bug.cgi?id=770121
Comment 3 Cosimo Cecchi 2016-08-29 20:48:03 UTC
Review of attachment 334368 [details] [review]:

::: test-tagged-entry.c
@@ +59,3 @@
   GtkWidget *window, *box, *entry, *toggle_visible_button, *toggle_tag_button;
   GdTaggedEntryTag *tag;
+  GResource *junk __attribute__ ((unused));;

Can you use G_GNUC_UNUSED instead?
Comment 4 Cosimo Cecchi 2016-08-29 20:48:24 UTC
Review of attachment 334369 [details] [review]:

Sure
Comment 5 Bastien Nocera 2016-08-30 09:20:54 UTC
Created attachment 334421 [details] [review]
tagged-entry: Fix missing GResource when using static library

gcc seems to be stripping away the "unused"
gd_tagged_entry_get_resource() when linking it. Call the function to
avoid the function being stripped away.

See https://bugzilla.gnome.org/show_bug.cgi?id=770121
Comment 6 Bastien Nocera 2016-08-30 09:21:56 UTC
With the above patch, we don't need to modify applications, so that would be the preferred fix. I also made the change mentioned in comment 3.
Comment 7 Michael Catanzaro 2016-08-30 10:13:17 UTC
(In reply to Bastien Nocera from comment #2)
> Created attachment 334369 [details] [review] [review]
> build: Force creation of the resource .h file
> 
> Otherwise automake will skip it as it is not included anywhere.

Wow.......
Comment 8 Michael Catanzaro 2016-08-30 10:17:08 UTC
Review of attachment 334421 [details] [review]:

::: libgd/gd-tagged-entry.c
@@ +917,3 @@
 {
   GtkCssProvider *provider;
+  GResource *junk G_GNUC_UNUSED;

If I saw this in code I maintain, I might delete it and discover my mistake later on. You could add a comment or use an obnoxiously-long variable name (e.g. do_not_optimize_away_get_resource) to make it clear.
Comment 9 Bastien Nocera 2016-08-30 10:22:32 UTC
Created attachment 334425 [details] [review]
tagged-entry: Fix missing GResource when using static library

gcc seems to be stripping away the "unused"
gd_tagged_entry_get_resource() when linking it. Call the function to
avoid the function being stripped away.

See https://bugzilla.gnome.org/show_bug.cgi?id=770121
Comment 10 Bastien Nocera 2016-09-05 11:29:15 UTC
Attachment 334369 [details] pushed as 8369805 - build: Force creation of the resource .h file
Attachment 334425 [details] pushed as 752f65e - tagged-entry: Fix missing GResource when using static library