# error "Bitcoin cannot be compiled without assertions." <<<<NOT



Summary:

In an email conversation from June 2014, Mike Hearn discusses the use of assertions with side effects in code. He explains that the codebase previously used them, but they have since been removed. To prevent their reintroduction, the code now refuses to compile without assertions enabled. Hearn suggests that allowing assertions with side effects and requiring them to be enabled could eliminate this class of errors. He also recommends using the glog library's CHECK macros, which print stack traces when they fail. Additionally, Hearn mentions that it only takes about 10 lines of code to create a nicer assert than the posix one, which he has implemented in his own software. However, he chose to use an IFDEF instead of dropping it in to be more cautious.


Updated on: 2023-05-19T18:58:12.489650+00:00