Re: [PATCH] C undefined behavior fix

From: David Woodhouse (dwmw2@infradead.org)
Date: Wed Jan 02 2002 - 17:24:14 EST


VANDROVE@vc.cvut.cz said:
> (and for CONSTANT < 5 it of course generated correct code to fill dst
> with string contents; and yes, I know that code will sigsegv on run
> because of dst is not initialized - but it should die at runtime, not
> at compile time).

An ICE, while it's not quite what was expected and it'll probably get fixed,
is nonetheless a perfectly valid implementation of 'undefined behaviour'.
You should count yourself lucky that the compiler didn't beat you up, sleep
with your mother, and/or start WW III.

Contributors to this thread who want to write a kernel in some C-like
language other than C probably ought to start by writing their own compiler,
rather than complaining about gcc. (I won't suggest starting with a language
spec, as the people in question don't really seem to be interested in
those.)

That or implement DWIM for gcc, I suppose...

Can we fix the broken code and stop being silly now, please?

--
dwmw2

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:18 EST