This is an archive of the discontinued LLVM Phabricator instance.

[NFC] [scudo] syntax-check DCHECK arguments if DCHECK is off
ClosedPublic

Authored by fmayer on Jan 13 2023, 11:20 AM.

Diff Detail

Event Timeline

fmayer created this revision.Jan 13 2023, 11:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2023, 11:20 AM
fmayer requested review of this revision.Jan 13 2023, 11:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2023, 11:20 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
Chia-hungDuan added inline comments.Jan 13 2023, 11:26 AM
compiler-rt/lib/scudo/standalone/internal_defs.h
139

Will it be better to have parenthesis? like (A) == (B)

fmayer marked an inline comment as done.Jan 13 2023, 11:29 AM
Chia-hungDuan accepted this revision.Jan 13 2023, 11:32 AM
This revision is now accepted and ready to land.Jan 13 2023, 11:32 AM

isn't this to suppress unused warnings?

then we will miss stuff like:
auto t = long_calculation();
DHCECK(t, expected);

vitalybuka accepted this revision.Jan 13 2023, 3:04 PM

isn't this to suppress unused warnings?

then we will miss stuff like:
auto t = long_calculation();
DHCECK(t, expected);

Not sure what exactly you mean, but yes, in that particular case the unused warning shouldn't fire anymore.

isn't this to suppress unused warnings?

then we will miss stuff like:
auto t = long_calculation();
DHCECK(t, expected);

Not sure what exactly you mean, but yes, in that particular case the unused warning shouldn't fire anymore.

CONS: seeing "unused warning" there is not a bug, but useful features.
PROS: complication of expression in release build to get error early is useful too.

so rather LGTM