Sujet : dbg_break macro
De : thiago.adams (at) *nospam* gmail.com (Thiago Adams)
Groupes : comp.lang.cDate : 05. Jun 2024, 15:49:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3ptto$vgqm$1@dont-email.me>
User-Agent : Mozilla Thunderbird
Checking the usages of assert(0) in my code it is used to create a breakpoint in unusual situations. Sample
if (condition) {
}
else {
assert(0); //unexpected
return 1;
}
I am thinking in replacing all my assert(0) for this macro.
#define dbg_break(message) assert(! "dbg_break" message );
if (condition) {
}
else {
dbg_break("unexpected");
return 1;
}
what do you think?
Do you have any other usage of assert(0) that is not this one?
Do you have any assert(constant-expression) other than assert(0)?