Hi Paul, Am Sa., 23. Mai 2020 um 19:33 Uhr schrieb Paul Eggert <egg...@cs.ucla.edu>:
> Probably not for -O0. I'm not so sure for -Og. Either way, we shouldn't rely > on > GCC's current behavior in this area as it is neither documented nor guaranteed > to stay the same. Agreed. > > #include <assert.h> > > #include "verify.h" > > > > #ifdef NDEBUG > > # define checked_assume(E) assume (E) > > #else > > # define checked_assume(E) assert (E) > > #endif > > Something like that would work, though the name "checked_assume" is misleading > since the assumption is not always checked. > > "affirm (E)" would be a better name, since the name's not being used anymore > by > the old software verification project[1] and it slides in well next to > "assume" > and "assert". (Some day we're going to run out of synonyms. :-) Believe it or not, but when I first proposed the (initial version of the) macro, I wanted to name it "affirm" after I had looked for synonyms. Only eventually, I switched to the name "checked_assume". But if "affirm" is fine with you, I would love to see it in a module. Either in verify or assure or in a new module named affirm.