Closed Bug 830326 Opened 7 years ago Closed 7 years ago

Get rid of warnings in the custom linker code

Categories

(Core :: mozglue, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file)

mozglue/linker/ElfLoader.cpp:577: warning: format '%p' expects type 'void*', but argument 4 has type 'ElfLoader::r_debug*'
mozglue/linker/ElfLoader.cpp:758: warning: format '%p' expects type 'void*', but argument 4 has type 'void (*)(int, siginfo*, void*)'
mozglue/linker/ElfLoader.cpp:766: warning: format '%p' expects type 'void*', but argument 4 has type 'void (*)(int)'
mozglue/linker/CustomElf.cpp:417: warning: too few arguments for format
mozglue/linker/Mappable.cpp:464: warning: comparison between signed and unsigned integer expressions
mozglue/linker/Mappable.cpp:467: warning: comparison between signed and unsigned integer expressions
mozglue/linker/Mappable.cpp:528: warning: format '%ld' expects type 'long int', but argument 6 has type 'unsigned int'
mozglue/linker/Mappable.cpp:528: warning: format '%ld' expects type 'long int', but argument 7 has type 'size_t'
mozglue/linker/SeekableZStream.cpp:64: warning: format '%ld' expects type 'long int', but argument 4 has type 'size_t'
mozglue/linker/SeekableZStream.cpp:64: warning: format '%ld' expects type 'long int', but argument 5 has type 'size_t'
mozglue/linker/SeekableZStream.cpp:76: warning: format '%ld' expects type 'long int', but argument 4 has type 'size_t'
mozglue/linker/SeekableZStream.cpp:76: warning: format '%ld' expects type 'long int', but argument 6 has type 'size_t'
mozglue/linker/SeekableZStream.cpp:76: warning: format '%ld' expects type 'long int', but argument 7 has type 'size_t'

clang also complains a lot with:
mozglue/linker/Logging.h:13:55: warning: Use of comma pasting extension is non-portable [-pedantic]
and
warning: varargs argument missing, but tolerated as an extension [-pedantic]
Comment on attachment 701797 [details] [diff] [review]
Get rid of warnings in the custom linker code

Review of attachment 701797 [details] [diff] [review]:
-----------------------------------------------------------------

::: mozglue/linker/Mappable.cpp
@@ +456,5 @@
>     * It is safe to run through lazyMaps here because the linker is never
>     * going to call mmap (which adds lazyMaps) while this function is
>     * called. */
>    size_t length = zStream.GetChunkSize(chunk);
> +  off_t chunkStart = chunk * zStream.GetChunkSize();

Technically you should cast chunk to off_t here, since sizeof(off_t) is not necessarily equal to sizeof(size_t).
Attachment #701797 - Flags: review?(nfroyd) → review+
https://hg.mozilla.org/mozilla-central/rev/6c19a1833693
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.