GNOME Bugzilla – Bug 751672
-Wduplicate-decl-specifier in glib/tests/keyfile.c
Last modified: 2015-06-30 01:45:07 UTC
glib-2.44.1 on OS X 10.8 (clang 5.1): CC keyfile.o keyfile.c:511:15: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] const gchar const *list[3]; ^ Putting "const" before or after "gchar" is equivalent. It looks like the intent was to have a const-pointer to an array of const-strings? That would be: const gchar * const list[3]; but that is an *error* because list[] are assigned later: list[0] = "one"; list[1] = "two;andahalf"; list[2] = "3"; But then they are not changed after that, so the declaration could simply assign the values: const gchar * const list[] = { "one", "two;andahalf", "3" };
Created attachment 306317 [details] [review] tests: Fix compiler warning Use `const gchar * const` to define a const array of const strings, and initialize the array when declaring it.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version. Attachment 306317 [details] pushed as 475445e - tests: Fix compiler warning