From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28079 invoked by alias); 2 Oct 2013 12:00:27 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 28067 invoked by uid 89); 2 Oct 2013 12:00:26 -0000 Received: from www.meduna.org (HELO meduna.org) (92.240.244.38) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 02 Oct 2013 12:00:26 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05 autolearn=ham version=3.3.2 X-HELO: meduna.org Received: from dial-95-105-165-4-orange.orange.sk ([95.105.165.4] helo=[127.0.0.1]) by meduna.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1VRL6I-0002d0-6j for ecos-discuss@ecos.sourceware.org; Wed, 02 Oct 2013 14:00:20 +0200 Message-ID: <524C0ACD.5090604@meduna.org> Date: Wed, 02 Oct 2013 12:00:00 -0000 From: Stanislav Meduna User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org References: <1380618091882-245807.post@n7.nabble.com> <1380713171328-245957.post@n7.nabble.com> In-Reply-To: <1380713171328-245957.post@n7.nabble.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authenticated-User: stano@meduna.org X-Authenticator: dovecot_plain X-Spam-Score: -6.9 X-Spam-Score-Int: -68 X-Exim-Version: 4.72 (build at 25-Oct-2012 18:35:58) X-Date: 2013-10-02 14:00:20 X-Connected-IP: 95.105.165.4:5143 X-Message-Linecount: 53 X-Body-Linecount: 38 X-Message-Size: 2109 X-Body-Size: 1373 X-Received-Count: 1 X-Recipient-Count: 1 X-Local-Recipient-Count: 1 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 X-IsSubscribed: yes Subject: Re: [ECOS] Re: Typo in assert error message causing confusion? X-SW-Source: 2013-10/txt/msg00003.txt.bz2 On 02.10.2013 13:26, Daniel Zebralla wrote: > I get your point of view. However, I assume that someone would like to know > what's broken instead of what would be the case if the message would have > not been displayed. The original assert macro that is in use for decades does _not_ contain an explanatory text and outputs the expression itself. See e.g. http://www.manpagez.com/man/3/assert/ I.e. if the programmer says "I am asserting that ptr != 0" and it is not true, it writes that the assertion "ptr != 0" failed. If the CYG_ASSERT follows this schema, it should definitely print what was expected. > If my system stops with a kernel panic and tells me > "Pointer is valid" I would be like -> oO. As Michael says, it should tell you something along the lines Assertion "Pointer is valid" failed which makes perfect sense. See comments at the top of host/infra/cyg_ass.h - it indeed defines it this way. CYG_ASSERT( pcount > 0, "Number of probes should be > 0!" ); Unfortunaly the very same file then spoils it with CYG_ASSERTCLASS( p, "Object at p is broken!" ); ;) Anyway, an assertion is a developer tool catching situations the developer thinks can never happen. As such they are not expected to be interpreted by anyone not able to look up the source code and investigate what exactly went wrong. -- Stano -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss