Hi Linus,
From cpp documentation:
------------------------------------- 8< ---------------------------------
__OPTIMIZE__
__OPTIMIZE_SIZE__
__NO_INLINE__
These macros describe the compilation mode. __OPTIMIZE__ is defined in
all optimizing compilations. __OPTIMIZE_SIZE__ is defined if the compiler
is optimizing for size, not speed. __NO_INLINE__ is defined if no functions
will be inlined into their callers (when not optimizing, or when inlining
has been specifically disabled by -fno-inline).
These macros cause certain GNU header files to provide optimized
definitions, using macros or inline functions, of system library functions.
You should not use these macros in any way unless you make sure that
programs will execute with the same effect whether or not they are defined.
If they are defined, their value is 1.
------------------------------------- 8< ---------------------------------
This patch is incomplete as it only does the __OPTIMIZE__ part, but its
enough for me to overcome the problem when compiling the kernel with
ostra-patch where I get problems with ntohs & friends, from
include/linux/byteorder/generic.h:
------------------------------------- 8< ---------------------------------
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
#define ___htonl(x) __cpu_to_be32(x)
#define ___htons(x) __cpu_to_be16(x)
#define ___ntohl(x) __be32_to_cpu(x)
#define ___ntohs(x) __be16_to_cpu(x)
#define htonl(x) ___htonl(x)
#define ntohl(x) ___ntohl(x)
#define htons(x) ___htons(x)
#define ntohs(x) ___ntohs(x)
#endif /* OPTIMIZE */
------------------------------------- 8< ---------------------------------
Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
Best Regards,
- Arnaldo
diff --git a/lib.c b/lib.c
--- a/lib.c
+++ b/lib.c
@@ -340,8 +340,11 @@ static char **handle_switch_U(char *arg,
static char **handle_switch_O(char *arg, char **next)
{
int level = 1;
- if (arg[1] >= '0' && arg[1] <= '9')
+ if (arg[1] >= '0' && arg[1] <= '9') {
level = arg[1] - '0';
+ if (level > 0)
+ add_pre_buffer("#define __OPTIMIZE__\n");
+ }
optimize = level;
return next;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html