Re: OOPS: 2.6.16-rc6 cpufreq_conservative

From: Linus Torvalds
Date: Sun Mar 19 2006 - 14:59:55 EST




On Sun, 19 Mar 2006, Al Viro wrote:
>
> In the version of gcc you've tested. With options and phase of moon
> being what they had been. IOW, you are awfully optimistic - it's not
> just using gcc extension, it's using undocumented (in the best case)
> behaviour outside the intended use of that extension.

I admit that it's ugly, but it's not undocumented. It flows directly from
"statements as expression". Once you do that, you have to do flow control
with them.

The end result may be _surprising_, the same way Duff's device is
surprising (and for the same reason). But a C compiler that doesn't
support Duff's device is not a C compiler. And this is really no
different: it may not bestandard C: but it _is_ standard and documented
GNU C.

And btw, this is _not_ new behaviour for the kernel. We have used
non-local control behaviour in statement expressions before, just do a

git grep '({.*return'

to see at least ten cases of that (in fact, check out NFA_PUT(), which
does a goto for the failure case in networking). That grep misses all the
multi-line cases, so I assume there are more of them.

So this definitely works, and is not new.

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