Last Comment Bug 766797 - Fix compiler warnings in APKOpen.cpp
: Fix compiler warnings in APKOpen.cpp
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: Trunk
: ARM Android
-- minor (vote)
: Firefox 16
Assigned To: Chris Peterson [:cpeterson]
: Sebastian Kaspari (:sebastian)
Depends on:
  Show dependency treegraph
Reported: 2012-06-20 17:22 PDT by Chris Peterson [:cpeterson]
Modified: 2016-07-29 14:25 PDT (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

fix-APKOpen-warnings.patch (5.33 KB, patch)
2012-06-20 17:23 PDT, Chris Peterson [:cpeterson]
mh+mozilla: review+
Details | Diff | Splinter Review

Description User image Chris Peterson [:cpeterson] 2012-06-20 17:22:37 PDT

Comment 1 User image Chris Peterson [:cpeterson] 2012-06-20 17:23:50 PDT
Created attachment 635145 [details] [diff] [review]

Sorry to keep bugging you about low-value warnings that pop up in APKOpen.cpp!

On my dev machine, APKOpen.cpp is always the first file to be compiled. I find myself doing a double-take *every* time I run make because the first thing I see are a bunch of warnings. <:)

I add a xul_dlsym() helper function consolidate the pedantic (uintptr_t) dlsym() casts in one place.

APKOpen.cpp:551: warning: unused variable 'skipLibCache'
APKOpen.cpp: In function 'mozglueresult loadGeckoLibs(const char*)':
APKOpen.cpp:745: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
android/APKOpen.cpp:753: warning: format '%ld' expects type 'long int', but argument 4 has type 'MOZTime'
Comment 2 User image Mike Hommey [:glandium] 2012-06-20 22:24:06 PDT
Comment on attachment 635145 [details] [diff] [review]

Review of attachment 635145 [details] [diff] [review]:

::: mozglue/android/APKOpen.cpp
@@ +408,5 @@
> +static uintptr_t
> +xul_dlsym(const char * symbolName)
> +{
> +  return (uintptr_t) __wrap_dlsym(xul_handle, symbolName);
> +}

While you're doing that, you could completely get rid of casting with something like:

template <typename T> void
xul_dl_sym(const char *symbolName, T *value)
  *value = (T)(uintptr_t)__wrap_dlsym(xul_handle, symbolName);
Comment 3 User image Chris Peterson [:cpeterson] 2012-06-21 17:31:08 PDT
Comment 4 User image Ed Morley [:emorley] 2012-06-22 03:44:08 PDT
Comment 5 User image Aaron Train [:aaronmt] 2012-07-26 11:20:32 PDT
Flipping flag, correct me if I'm wrong.
Comment 6 User image Chris Peterson [:cpeterson] 2012-07-26 12:40:23 PDT
Thanks for fixing the status. You are correct.

Note You need to log in before you can comment on or make changes to this bug.