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 347262 - Warnings when compiling gnome-games
Warnings when compiling gnome-games
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
2.15.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-11 23:14 UTC by Andreas Røsdal
Modified: 2006-09-29 17:23 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Freecell maximized 2.14 (145.00 KB, image/png)
2006-08-14 04:14 UTC, Gonzalo Odiard
  Details
Freecell maximized 2.15 (167.12 KB, image/png)
2006-08-14 04:15 UTC, Gonzalo Odiard
  Details
Patch to fix warnings in Bug 347262 (1.44 KB, patch)
2006-09-25 20:39 UTC, Santiago Martinez
none Details | Review
patch to fix the warnings (3.31 KB, patch)
2006-09-25 23:19 UTC, Tom Tromey
none Details | Review

Description Andreas Røsdal 2006-07-11 23:14:48 UTC
The following warnings are shown when compiling gnome-games 2.15.4:

games-files.c: In function 'games_file_list_find':
games-files.c:347: warning: assignment from incompatible pointer type
games-preimage.c: In function 'games_preimage_new_from_file':
games-preimage.c:189: warning: dereferencing type-punned pointer will break strict-aliasing rules
sol.c: In function ‘game_file_to_name’:
sol.c:102: warning: value computed is not used
Comment 1 Gonzalo Odiard 2006-08-14 04:14:56 UTC
Created attachment 70845 [details]
Freecell maximized 2.14
Comment 2 Gonzalo Odiard 2006-08-14 04:15:46 UTC
Created attachment 70846 [details]
Freecell maximized 2.15
Comment 3 Gonzalo Odiard 2006-08-15 00:28:55 UTC
Comment on attachment 70845 [details]
Freecell maximized 2.14

sorry, this image is for bug 341253
Comment 4 Gonzalo Odiard 2006-08-15 00:29:23 UTC
Comment on attachment 70846 [details]
Freecell maximized 2.15

sorry, this image is for bug 341253
Comment 5 Santiago Martinez 2006-09-25 20:39:48 UTC
Created attachment 73390 [details] [review]
Patch to fix warnings in Bug 347262
Comment 6 Santiago Martinez 2006-09-25 20:42:10 UTC
Comment on attachment 73390 [details] [review]
Patch to fix warnings in Bug 347262

Hi all, I downloaded last version from CVS and found this warnings:

games-files.c: In function 'games_file_list_find':
games-files.c:347: warning: assignment from incompatible pointer type
games-preimage.c: In function 'games_preimage_new_from_file':
games-preimage.c:189: warning: dereferencing type-punned pointer will break strict-aliasing rules
games-scores-backend.c: In function 'games_scores_backend_set_scores':
games-scores-backend.c:271: warning: format '%lld' expects type 'long long int', but argument 3 has type 'guint64'

So here comes the patch to fix this warnings.
Comment 7 Tom Tromey 2006-09-25 23:19:49 UTC
Created attachment 73404 [details] [review]
patch to fix the warnings

This patch fixes all the warnings reported.  ChangeLog entries included.

I think the other patch here is incorrect.  It says:
   (gchar **)(preimage->srcbuffer)
but my understanding of the API is that a gchar** is needed
since this is a result argument.  The GCC warning here occurs
because it is not valid to cast from guchar** to gchar**; that
is an aliasing violation (AIUI).  The fix, which IMO is fairly
ugly, is to add an intermediate cast to char*.
Comment 8 Andreas Røsdal 2006-09-29 17:23:45 UTC
I have tested and applied the patch from Tom Tromey to CVS and the 2.16 branch.  Thanks!