Path: csiph.com!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= Newsgroups: comp.dsp,sci.electronics.design,comp.arch.embedded Subject: Re: PID Without a PhD, Finally Date: Sat, 16 Apr 2016 19:52:17 +0200 Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.dfncis.de plY8cINxqRnrNOQA0+FTngQS/fErafrVJwSlhVK6RNm+YFWQZ4lSozelBm Cancel-Lock: sha1:N+pgU+EJgyuC+E/rfx8emduVOxU= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 In-Reply-To: Xref: csiph.com comp.dsp:31264 sci.electronics.design:407835 comp.arch.embedded:23683 Am 15.04.2016 um 22:05 schrieb Tim Wescott: > On Fri, 15 Apr 2016 21:19:50 +0200, Hans-Bernhard Bröker wrote: >> And for good measure, better make those static_assert()s so they trigger >> at compile time, instead of trying to abort at run time with a >> message--- which in an embedded system often has nowhere to go. > Most of my embedded systems will at least make a light blink oddly when > you hit an assert -- but that's not a Good Thing normally. Which is why a static_assert() is so strongly preferable over assert(), wherever applicable: instead of trying to figure out which of your assert()s might have triggered the panic LED at run time (invariably at a customer site, 9 time zones away through heavy weather), you get a message at compile time, right there in the coziness of your place of work. static_assert() solves most of the perceived problems that drive people to demand the C preprocessor should know about things like sizeof().