GNOME Bugzilla – Bug 710345
[Patches] Fix some redundant-decls
Last modified: 2013-10-20 19:45:48 UTC
The following are patches to fix some redundant-decls reports. I just fixed the ones that seem obvious and not related to a specific OS or system. There is a one that's get reported several times: 'g_mem_gc_friendly' global variable declared in gmem.h and glib-init.h, the declaration inside gmem.h is the older one. This is related to this commit 47444dacc069be5984: Deprecate g_thread_init() which is related to thread-safety, more on https://bugzilla.gnome.org/show_bug.cgi?id=660744 Since this is thread-safety stuff and perhaps others parts? I didn't touch it. Thanks.
Created attachment 257472 [details] [review] gconvert: fix redundant-decls of _g_charset_get_aliases() _g_charset_get_aliases() is already declared in gcharsetprivate.h which was added by commit 4c2a6595889eff44fa, and gconvert.c includes this gcharsetprivate header, so no need to declare it again.
Created attachment 257473 [details] [review] gutils: fix redundant-decls of g_init_user_config_dir() g_init_user_config_dir() is already declared as static in this gutils.c file, so just remove the redundant declaration.
Created attachment 257474 [details] [review] gio/gbufferedinputstream: fix redundant-decls of g_buffered_input_stream_finalize() g_buffered_input_stream_finalize() is already declared as static in this gbufferedinputstream.c file, so just remove the redundant declaration.
(In reply to comment #0) > There is a one that's get reported several times: > 'g_mem_gc_friendly' global variable declared in gmem.h and glib-init.h, the > declaration inside gmem.h is the older one. > > This is related to this commit 47444dacc069be5984: Deprecate g_thread_init() > which is related to thread-safety, more on > https://bugzilla.gnome.org/show_bug.cgi?id=660744 > > Since this is thread-safety stuff and perhaps others parts? I didn't touch it. The commits that moved things around were related to thread-safety, but the declarations themselves are entirely a compile-time matter, so there are no thread-safety concerns with where they are. Feel free to attach a patch to fix that one too.
(In reply to comment #4) > (In reply to comment #0) > > There is a one that's get reported several times: > > 'g_mem_gc_friendly' global variable declared in gmem.h and glib-init.h, the > > declaration inside gmem.h is the older one. > > > > This is related to this commit 47444dacc069be5984: Deprecate g_thread_init() > > which is related to thread-safety, more on > > https://bugzilla.gnome.org/show_bug.cgi?id=660744 > > > > Since this is thread-safety stuff and perhaps others parts? I didn't touch it. > > The commits that moved things around were related to thread-safety, but the > declarations themselves are entirely a compile-time matter, so there are no > thread-safety concerns with where they are. Feel free to attach a patch to fix > that one too. Ok, I'm attaching two patches that fix this. Thanks Dan!
Created attachment 257752 [details] [review] [PATCH 1/2] gmem: remove glib-init.h inclusion [PATCH 1/2] gmem: remove glib-init.h inclusion No need to include glib-init.h here. This was added by commit 47444dacc069be but that commit did not make use of any its exported symbols, so just remove it.
Created attachment 257753 [details] [review] [PATCH 2/2] glib-init: fix redundant-decls of g_mem_gc_friendly Currently g_mem_gc_friendly is declared in both gmem.h and glib-init.h files, we will have reports on each unit that include these two files. This patch removes the redundant declaration from glib-init.h Since g_mem_gc_friendly is related to gmem.h and was first declared in this header which also exports it via glib.h, then declare it in gmem.h Other files already include gmem.h: garray.c and gslice.c, no need to change anything.
great. thanks