mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] Add missing #include <linux/bug.h>
@ 2016-04-25 18:10 Eric Engestrom
  2016-04-25 18:36 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Engestrom @ 2016-04-25 18:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Eric Engestrom, Andrew Morton, Joe Perches, Hannes Frederic Sowa,
	Rasmus Villemoes, David S. Miller, Daniel Borkmann,
	Andrey Ryabinin

ARRAY_SIZE uses BUILD_BUG_ON_ZERO, which is undefined is you don't
include linux/bug.h first, which just happened to me.

Is there any reason this include isn't here? A quick grep found 595
other files using a define from bug.h without ever including it.

If this is a simple mistake and was forgotten, I can send an actual
patchset to fix this, but it feels like it was left out on purpose.

Cheers,
  Eric Engestrom

PS: If this is a cleanup that needs to be done, I might to it for other
headers as well.

---
 include/linux/compiler-gcc.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index eeae401..01e6869 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -2,6 +2,8 @@
 #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
 #endif
 
+#include <linux/bug.h>
+
 /*
  * Common definitions for all gcc versions go here.
  */
-- 
2.8.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-25 18:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-25 18:10 [RFC] Add missing #include <linux/bug.h> Eric Engestrom
2016-04-25 18:36 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®