Closed Bug 1611635 Opened 5 months ago Closed 5 months ago

TestPrintf.cpp: error: '%s' directive argument is null [-Werror=format-overflow=]

Categories

(Firefox Build System :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(firefox74 fixed)

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

 0:10.65 In function 'void TestPrintfFormats()',
 0:10.65     inlined from 'int main()' at /root/firefox-gcc-last/mozglue/tests/TestPrintf.cpp:156:20:
 0:10.65 /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Likely.h:17:46: error: '%s' directive argument is null [-Werror=format-overflow=]
 0:10.65    17 | #  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))
 0:10.65       |                                              ^~~~
 0:10.65 /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:464:9: note: in expansion of macro 'MOZ_UNLIKELY'
 0:10.65   464 |     if (MOZ_UNLIKELY(!MOZ_CHECK_ASSERT_ASSIGNMENT(expr))) {    \
 0:10.65       |         ^~~~~~~~~~~~
 0:10.65 /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:482:31: note: in expansion of macro 'MOZ_ASSERT_HELPER1'
 0:10.65   482 | #define MOZ_ASSERT_GLUE(a, b) a b
 0:10.65       |                               ^
 0:10.65 /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:484:3: note: in expansion of macro 'MOZ_ASSERT_GLUE'
 0:10.65   484 |   MOZ_ASSERT_GLUE(                                                    \
 0:10.65       |   ^~~~~~~~~~~~~~~
 0:10.65 /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/MacroArgs.h:16:26: note: in expansion of macro 'MOZ_CONCAT2'
 0:10.65    16 | #define MOZ_CONCAT(x, y) MOZ_CONCAT2(x, y)
 0:10.65       |                          ^~~~~~~~~~~
 0:10.65 /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/MacroArgs.h:70:51: note: in expansion of macro 'MOZ_CONCAT'
 0:10.65    70 | #define MOZ_PASTE_PREFIX_AND_ARG_COUNT_GLUE(a, b) a b
 0:10.65       |                                                   ^
 0:10.65 /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/MacroArgs.h:72:3: note: in expansion of macro 'MOZ_PASTE_PREFIX_AND_ARG_COUNT_GLUE'
 0:10.66    72 |   MOZ_PASTE_PREFIX_AND_ARG_COUNT_GLUE(MOZ_CONCAT,    \
 0:10.66       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 0:10.66 /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:485:7: note: in expansion of macro 'MOZ_PASTE_PREFIX_AND_ARG_COUNT'
 0:10.66   485 |       MOZ_PASTE_PREFIX_AND_ARG_COUNT(MOZ_ASSERT_HELPER, __VA_ARGS__), \
 0:10.66       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 0:10.66 /root/firefox-gcc-last/mozglue/tests/TestPrintf.cpp:99:3: note: in expansion of macro 'MOZ_RELEASE_ASSERT'
 0:10.66    99 |   MOZ_RELEASE_ASSERT(print_one("(null)", "%s", zero()));
 0:10.66       |   ^~~~~~~~~~~~~~~~~~
 0:10.74 cc1plus: all warnings being treated as errors
Assignee: nobody → sledru
Status: NEW → ASSIGNED
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b6b9690c58a9
TestPrintf.cpp: remove a test - causes a warning with gcc > 9 r=froydnj
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.