On Tue, Mar 10, 2009 at 3:59 AM, Stoyan Gaydarov <[email protected]> wrote:
> I know that function calls should not normally be inside the BUG_ON
> params but what about sizeof?
>
> so would something like this work as intended:
>
> BUG_ON(expect != sizeof(foo));

IIRC sizeof is not actually a function. Its value is known by the compiler.

> also what about bit operations? so like BUG_ON(s & 3); would that
> still be ok since it doesn't actually modify the original value?

Right. I think the idea is not to have side effects.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to