summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-01-07 12:47:07 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-01-07 12:58:19 +0000
commit8888dbe12a633684e3a7e4eff89d7c12299334f9 (patch)
tree6a7652ae23b10fc3f0a1af5da74e6d5d8d69d3ef /distrib
parent978ea35e37b49ffde28b0536e44362b66f3187b4 (diff)
downloadhaskell-wip/t20899.tar.gz
Change assertions in Stats.c to warnings (and introduce WARN macro)wip/t20899
ASSERT should be used in situations where something very bad will happen later on if a certain invariant doesn't hold. The idea is that IF we catch the assertion earlier then it will be easier to work out what's going on at that point rather than at some indeterminate point in the future of the program. The assertions in Stats.c do not obey this philsophy and it is quite annoying if you are running a debug build (or a ticky compiler) and one of these assertions fails right at the end of your program, before the ticky report is printed out so you don't get any profiling information. Given that nothing terrible happens if these assertions are not true, or at least the terrible thing will happen in very close proximity to the assertion failure, these assertions use the new WARN macro which prints the assertion failure to stdout but does not exit the program. Of course, it would be better to fix these metrics to not trigger the assertion in the first place but if they did fail again in the future it is frustrating to be bamboozled in this manner. Fixes #20899
Diffstat (limited to 'distrib')
0 files changed, 0 insertions, 0 deletions