snag of G_LIKELY()
- From: Daniel Elstner <daniel elstner gmx net>
- To: gtk-devel-list gnome org
- Subject: snag of G_LIKELY()
- Date: 22 Nov 2002 17:09:51 +0100
Hi,
while using in G_LIKELY() in g_return_if_fail() and friends reduces the
debugging overhead, there is an unfortunate snag: Users of gcc > 3
won't get a warning anymore if they accidentally put an assignment in
the asserted condition.
See this thread for info:
http://mail.gnome.org/archives/gtk-devel-list/2002-February/msg00184.html
I'm not promoting to remove G_LIKELY() -- I just think everyone should
be aware of this catch. Also, there's no point in doing
if (G_LIKELY (expr)) { } else
anymore since the empty if() branch was only there to trigger the GCC
warning in case of an assignment in the condition.
Regards,
--Daniel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]