Closed Bug 560393 Opened 15 years ago Closed 15 years ago

Fix warning: format [FORMAT] expects type [TYPE], but argument [N] has type [OTHER TYPE]

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

References

()

Details

(Whiteboard: [build_warning])

Attachments

(3 files)

Filing this bug on fixing warnings of the form: > format [FORMAT] expects type [TYPE], but argument [N] has type [OTHER TYPE] In the 32-bit OS X clobber build linked in URL field, there are 19 of these. (I tripped over one of them when doing a tryserver build with warnings-as-errors enabled in certain warning-free-on-linux directories.)
This patch fixes two instances of this warning: > toolkit/components/places/tests/cpp/places_test_harness_tail.h:118: warning: format '%d' expects type 'int', but argument 4 has type 'size_t' > toolkit/components/places/tests/cpp/places_test_harness_tail.h:118: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #443543 - Flags: review?(sdwilsh)
(er, it fixes those two warnings, I meant.)
This patch addresses these build warnings: > xpcom/typelib/xpt/tools/xpt_dump.c:230: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' > xpcom/typelib/xpt/tools/xpt_dump.c:230: warning: format '%d' expects type 'int', but argument 4 has type 'size_t' > xpcom/typelib/xpt/tools/xpt_link.c:239: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' > xpcom/typelib/xpt/tools/xpt_link.c:239: warning: format '%d' expects type 'int', but argument 4 has type 'size_t' > xpcom/components/nsNativeComponentLoader.cpp:176: warning: format '%lx' expects type 'long unsigned int', but argument 4 has type 'nsresult' > xpcom/tests/TestCOMPtr.cpp:371: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' > xpcom/tests/TestHashtables.cpp:463: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' > xpcom/tests/TestHashtables.cpp:530: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' > xpcom/tests/TestHashtables.cpp:595: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' > xpcom/tests/TestHashtables.cpp:664: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' > xpcom/tests/TestHashtables.cpp:732: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' > xpcom/tests/TestHashtables.cpp:808: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' > xpcom/tests/TestHashtables.cpp:882: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' > xpcom/tests/TestRefPtr.cpp:371: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
Attachment #443557 - Flags: review?(benjamin)
This patch adds "unsigned long" casts to address these warnings: > netwerk/test/TestIncrementalDownload.cpp:76: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'PRUint32' > netwerk/test/TestIncrementalDownload.cpp:76: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'PRUint32'
Attachment #443558 - Flags: review?
Attachment #443558 - Flags: review? → review?(jduell.mcbugs)
Whiteboard: [build_warning]
Comment on attachment 443543 [details] [diff] [review] Part 1: fix for places directory [landed] r=sdwilsh
Attachment #443543 - Flags: review?(sdwilsh) → review+
Comment on attachment 443543 [details] [diff] [review] Part 1: fix for places directory [landed] Landed part 1: http://hg.mozilla.org/mozilla-central/rev/95744c36212c
Attachment #443543 - Attachment description: Part 1: fix for places directory → Part 1: fix for places directory [landed]
Attachment #443558 - Flags: review?(jduell.mcbugs) → review+
Comment on attachment 443558 [details] [diff] [review] Part 3: fix for netwerk directory [landed] Landed part 3: http://hg.mozilla.org/mozilla-central/rev/95d99c944202
Attachment #443558 - Attachment description: Part 3: fix for netwerk directory → Part 3: fix for netwerk directory [landed]
Attachment #443557 - Flags: review?(benjamin) → review+
Comment on attachment 443557 [details] [diff] [review] Part 2: fix for xpcom directory [landed] Landed part 2: http://hg.mozilla.org/mozilla-central/rev/5c2d7b8d9e7c
Attachment #443557 - Attachment description: Part 2: fix for xpcom directory → Part 2: fix for xpcom directory [landed]
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: