Page MenuHomePhabricator

[lldb] [unittests] Use non-empty format string for Timer()

Authored by mgorny on Feb 26 2019, 8:42 AM.



Pass dummy '.' as format string for Timer() rather than an empty string,
in order to silence gcc warnings about empty format string
(-Wformat-zero-length). The actual format string is irrelevant
to the test in question.

Diff Detail

Event Timeline

mgorny created this revision.Feb 26 2019, 8:42 AM

Honestly, I think I'd just change the tests to use a non-zero format string. It's a silly warning, but it probably not worth bloating our cmake code because of it. I mean, it's not like the tests actually *have* to have an empty string. The string is just empty because there wasn't anything useful to put there.

mgorny updated this revision to Diff 188430.Feb 26 2019, 11:43 AM
mgorny retitled this revision from [lldb] [unittests] Silence -Wformat-zero-length warnings in UtilityTests to [lldb] [unittests] Use non-empty format string for Timer().
mgorny edited the summary of this revision. (Show Details)

Changed to use '.' instead. Thanks for the suggestion, I like this option more too ;-). I have wrongly assumed the tests purposely check whether empty string works correctly.

labath accepted this revision.Feb 26 2019, 12:05 PM

Thanks for tackling this. I've been annoyed by this warning too, but I haven't gotten around to doing anything about it yet. :/

This revision is now accepted and ready to land.Feb 26 2019, 12:05 PM

Heh, and I thought we're (NetBSD) the only ones getting it ;-).

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 26 2019, 12:14 PM