From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BcKY2-0000D6-BA for qemu-devel@nongnu.org; Mon, 21 Jun 2004 04:53:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BcKXu-0000Cu-RN for qemu-devel@nongnu.org; Mon, 21 Jun 2004 04:52:57 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcKXu-0000Cr-OE for qemu-devel@nongnu.org; Mon, 21 Jun 2004 04:52:54 -0400 Received: from [62.53.231.247] (helo=e.frontend.um.mediaways.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1BcKWQ-0003qn-6c for qemu-devel@nongnu.org; Mon, 21 Jun 2004 04:51:22 -0400 Message-ID: <40D6A164.2010109@petig-baender.de> Date: Mon, 21 Jun 2004 10:50:44 +0200 From: Christof Petig MIME-Version: 1.0 Subject: OT: C Q/As, was Re: [Qemu-devel] security_20040618 References: <20040619150514.GB1962@sentinelchicken.org> <20040620192652.GA1927@sentinelchicken.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: gmane@chqrlie.org Cc: qemu-devel@nongnu.org Charlie Gordon schrieb: > Charlie the C teaser. > --------------------- > one of my favorite Q/As : what is wrong with : enum BOOL { FALSE=0, > TRUE=1 }; ? can you enlighten me? The only drawback I see is that with plain C (no C++) typedef enum { ... } BOOL; would be more appropriate. I would propose #ifndef __cplusplus typedef enum { false, true } bool; #endif as the optimal solution for a problem I hardly have (since I usually don't go back to coding in C) Christof PS: I used to ask: Why does this crash later (if you are lucky) const char *itoa(int i) { char x[20]; snprintf(x,sizeof x,"%d",i); return x; }