util/check.h
does this job: https://github.com/bitcoin/bitcoin/blob/42b66a6b814bca130a9ccf0a3f747cf33d628232/src/util/check.h#L45-L47
util: Drop redundant NDEBUG check #20274
pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:201030-ndebug changing 2 files +1 −7-
hebasto commented at 4:44 pm on October 30, 2020: memberThe
-
in src/util/check.h:47 in 05a315614c outdated
41@@ -42,10 +42,6 @@ class NonFatalCheckError : public std::runtime_error 42 } \ 43 } while (false) 44 45-#if defined(NDEBUG) 46-#error "Cannot compile without assertions!" 47-#endif
MarcoFalke commented at 4:56 pm on October 30, 2020:This is where ourAssert
is defined, so I think it makes sense to have the compiler check here.
MarcoFalke commented at 5:08 pm on October 30, 2020:NDEBUG is a compile flag that can change for each compilation unit, not a fixed architecture property like the other assumptions.
For example, it might be possible to compile validation.o with NDEBUG (accidentally), the rest of Bitcoin Core without it. The resulting binary will misbehave. (Haven’t checked that though).
hebasto commented at 5:16 pm on October 30, 2020:Thanks for elaboration!
So redundant code is in
compat/assumptions.h
, right?
MarcoFalke commented at 5:20 pm on October 30, 2020:So redundant code is in compat/assumptions.h, right?
Seems fine to remove that
hebasto commented at 5:29 pm on October 30, 2020:Updated.MarcoFalke added the label Build system on Oct 30, 2020hebasto force-pushed on Oct 30, 2020util: Drop redundant NDEBUG check
util/check.h does this job.
hebasto force-pushed on Oct 30, 2020fanquake commented at 2:58 am on October 31, 2020: memberNOTE: If this does get merged we’ll also need to update the stripbuildinfo.patchpracticalswift commented at 9:35 am on October 31, 2020: contributorThe goal of
src/compat/assumptions.h
is to document all system assumptions we make we make.The assumption that the macro
NDEBUG
is not defined is an important such assumption, so please don’t remove theNDEBUG
documentation fromsrc/compat/assumptions.h
:)hebasto closed this on Oct 31, 2020
DrahtBot locked this on Feb 15, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 01:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 01:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me