Deutsch   English   Français   Italiano  
<v3uru9$227qm$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Thiago Adams <thiago.adams@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: dbg_break macro
Date: Fri, 7 Jun 2024 08:46:17 -0300
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <v3uru9$227qm$1@dont-email.me>
References: <v3ptto$vgqm$1@dont-email.me>
 <pan$c5a7f$519c50bb$a44bc8ca$b7510c5d@invalid.invalid>
 <v3t6ru$1jpih$2@dont-email.me> <v3uect$1vrug$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 07 Jun 2024 13:46:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="9d872bac7ba674665629f70e0cfcb319";
	logging-data="2170710"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19Exe8zQTZYEdL4sLl7IEE5imb2VQbBvc8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:t0pCaGu9313m7PJUhyCZtI5L3MA=
Content-Language: en-US
In-Reply-To: <v3uect$1vrug$1@dont-email.me>
Bytes: 1770

On 07/06/2024 04:55, David Brown wrote:
> Certainly dbg_break is a better name, IMHO.  But I'd want a reason for 
> the halt, especially if you are not running the code under a debugger at 
> the time.



I have many samples of the usage of assert(0) being
"debug break, check this!, it can be an error"

if (condition1) {
   //...
}
else if (condition2) {
   //...
}
else if (condition3) {
   #warning TODO case 3 not implemented
   dbg_break("TODO case 3 not implemented");
}


if (ResourceNotAvailable())
{
    dbg_break("really unexpected");
    return -1;
}





etc