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 723065 - [PATCH] Wrong main function declaration and missing includes
[PATCH] Wrong main function declaration and missing includes
Product: gnome-maps
Classification: Applications
Component: general
git master
Other FreeBSD
: Normal normal
: ---
Assigned To: gnome-maps-maint
Depends on:
Reported: 2014-01-27 02:44 UTC by Ting-Wei Lan
Modified: 2014-02-05 13:20 UTC
See Also:
GNOME target: ---
GNOME version: ---

Add #include <libintl.h> and correct main function declaration (359 bytes, patch)
2014-01-27 02:44 UTC, Ting-Wei Lan
none Details | Review

Description Ting-Wei Lan 2014-01-27 02:44:11 UTC
Created attachment 267268 [details] [review]
Add #include <libintl.h> and correct main function declaration

The type of the second argument of main function should be char* [], not char*.
This file use functions from gettext, so #include <libintl.h> is needed.
Comment 1 Mattias Bengtsson 2014-01-27 09:13:56 UTC
Review of attachment 267268 [details] [review]:

::: src/main.c
@@ +24,3 @@
 #include <girepository.h>
 #include <gjs/gjs.h>
+#include <libintl.h>

Why is this needed?

When I do the following:

$ export LANG=sv_SE.UTF-8; gnome-maps

... in a jhbuild shell with current master (without your patch) it seems to work fine. 
Just asking so that I understand what your patch does and why. :)

@@ +30,2 @@
   const char *search_path[] = { "resource:///org/gnome/maps", NULL };

Comment 2 Ting-Wei Lan 2014-01-27 13:05:53 UTC
35 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
36 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
37 textdomain (GETTEXT_PACKAGE);

These 3 lines use functions from libintl.h. Add #include <libintl.h> to prevent implicit declarations. Some compilers allow implicit declarations, but this may cause problem on some systems.
Comment 3 Zeeshan Ali 2014-01-27 14:48:56 UTC
Review of attachment 267268 [details] [review]:

::: src/main.c
@@ +24,3 @@
 #include <girepository.h>
 #include <gjs/gjs.h>
+#include <libintl.h>

I don't think including a header has anything to do with l10n at runtime. Are you sure he is not fixing one of those compiler warnings you introduced. :)
Comment 4 Zeeshan Ali 2014-01-27 14:50:15 UTC
Review of attachment 267268 [details] [review]:

Please try to follow the guidelines for commit logs:
Comment 5 Zeeshan Ali 2014-02-05 13:06:39 UTC
Oh great, Ting-Wei didn't follow up on the patch and we forgot about this all together. Now our latest release is broken in fedora builds :(
Comment 6 Zeeshan Ali 2014-02-05 13:09:45 UTC
And I only now realize that patch does not have a log at all cause it was generated as `git diff`. Please use `git format-patch` to create the patch or simply use git-bz for an easy way to submit patches.
Comment 7 Zeeshan Ali 2014-02-05 13:20:16 UTC
Pushed modified versions of attached patch, mainly just divided it into seperate patches and fixed another issue.