Re: [PATCH] kvm tools: Use assert() helper to check a variable value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:

> +#
> +#define BUILD_BUG_ON(condition)	((void)sizeof(char[1 - 2*!!(condition)]))
> +#define BUG_ON(condition)	assert(!(condition))

Just a sidenote, the patch is fine but the above will result in 
weird double negated assertion messages.

it's better to just do our own __BUG() function and use it. That 
way it can also use the kernel standard 'BUG: ...' message 
format.

To make such BUG()s easier to debug via GDB, do this from the 
__BUG() handler:

	raise(SIGABRT);

GDB will catch that signal.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux