Thread (9 messages) 9 messages, 5 authors, 2009-09-24

Re: [PATCH 01/10] Add support for GCC-4.5's __builtin_unreachable() to compiler.h

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2009-09-12 07:22:43
Also in: linux-alpha, linux-mips, linux-s390, lkml

On Fri, Sep 11, 2009 at 17:58, David Daney[off-list ref] wrote=
:
Michael Buesch wrote:
quoted
On Friday 11 September 2009 01:56:42 David Daney wrote:
quoted
+/* Unreachable code */
+#ifndef unreachable
+# define unreachable() do { for (;;) ; } while (0)
+#endif
# define unreachable() do { } while (1)

? :)
Clearly I was not thinking clearly when I wrote that part. =C2=A0RTH note=
d the
same thing. =C2=A0I will fix it.
However, people are so used to seeing the `do { } while (0)' idiom,
that they might miss
there's a `1' here, not a `0'.

So perhaps it's better to use plain `for (;;)' for infinite loops?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k=
.org

In personal conversations with technical people, I call myself a hacker. Bu=
t
when I'm talking to journalists I just say "programmer" or something like t=
hat.
							    -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help