Skip to contentSkip to conversation

2.5.3-pre1 compile error

PATCH Andi Kleen 3 participants 3 messages Jan 16, 2002 – Jan 17, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
Quoted 8 lines · Linus Torvalds

Review

Quoted 4 lines
(quoted diff) +3 -0
+#ifndef __ASM__ATOMIC_H
+#include <asm/atomic.h>
+#endif

Please do not assume knowdledge of what the different header files use to define their re-entrancy.

Quoted 5 lines

Just do

	#include <asm/atomic.h>

and be done with it.

The first check is done automatically by the gcc preprocessor anyways (it has a special check for the #ifndef BLA_H #define BLA_H #endif construct for whole files and doesn't even bother to open them again on a second include). So it's completely unnecessary.

Someone added some of these useless checks to 2.5.3pre1. Here is a patch to remove them. Please consider applying.

include/linux/file.h renamed from include/linux/file.h-o +0 -4
@@ -5,12 +5,8 @@
 #ifndef __LINUX_FILE_H
 #define __LINUX_FILE_H
 
-#ifndef _LINUX_POSIX_TYPES_H	/* __FD_CLR */
 #include <linux/posix_types.h>
-#endif
-#ifndef __LINUX_COMPILER_H	/* unlikely */
 #include <linux/compiler.h>
-#endif
 
 /*
  * The default fd array needs to be at least BITS_PER_LONG,
include/linux/init_task.h renamed from include/linux/init_task.h-o +0 -2
@@ -1,9 +1,7 @@
 #ifndef _LINUX__INIT_TASK_H
 #define _LINUX__INIT_TASK_H
 
-#ifndef __LINUX_FILE_H
 #include <linux/file.h>
-#endif
 
 #define INIT_FILES \
 { 							\

-Andi

#2 lore raw
Quoted 4 lines · Andi Kleen

The first check is done automatically by the gcc preprocessor anyways (it has a special check for the #ifndef BLA_H #define BLA_H #endif construct for whole files and doesn't even bother to open them again on a second include). So it's completely unnecessary.

Ahah! I knew I didn't imagine it. Either that or we've both had the same hallucination. 8-)

Signature · 2 lines
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs
#3 lore raw
In reply to Andi Kleen

Dave Jones wrote:-

Quoted 9 lines · Andi Kleen
Quoted 5 lines

The first check is done automatically by the gcc preprocessor anyways (it has a special check for the #ifndef BLA_H #define BLA_H #endif construct for whole files and doesn't even bother to open them again on a second include). So it's completely unnecessary.

Ahah! I knew I didn't imagine it. Either that or we've both had the same hallucination. 8-)

I told you over a beer, so maybe you were hallucinating 8^)

Neil.