Re: [Compile Regression in 2.4.25-pre8][PATCH 37/42]

From: Philippe Elie
Date: Tue Feb 03 2004 - 16:58:28 EST


On Tue, 03 Feb 2004 at 22:07 +0000, Kronos wrote:

> Ok, I cooked up this patch. BUG() is a function marked as noreturn that is
> always inlined. Unfortunately, gcc prior to 3.x does not support
> __always_inline__ attribute, so I had to revert to the old macro with older
> compiler.
>
> The patch fixes warnings with newer compiler, but not with older ones.
> Note that the while(1) is needed, otherwise gcc will say that the
> function marked as noreturn does actually return.
>
> Comments?
>
> diff -Nru -X dontdiff linux-2.4-vanilla/include/asm-i386/page.h linux-2.4/include/asm-i386/page.h
> --- linux-2.4-vanilla/include/asm-i386/page.h Tue Nov 11 18:05:52 2003
> +++ linux-2.4/include/asm-i386/page.h Tue Feb 3 07:26:04 2004
> @@ -10,6 +10,7 @@
> #ifndef __ASSEMBLY__
>
> #include <linux/config.h>
> +#include <linux/compiler.h>
>
> #ifdef CONFIG_X86_USE_3DNOW
>
> @@ -94,6 +95,26 @@
> * The offending file and line are encoded after the "officially
> * undefined" opcode for parsing in the trap handler.
> */
> +#ifdef __bug
> +#if 1 /* Set to zero for a slightly smaller kernel */
> +__bug void __bugfn(void) {
> + while(1) {
> + __asm__ __volatile__( "ud2\n"
> + "\t.word %c0\n"
> + "\t.long %c1\n"
> + : : "i" (__LINE__), "i" (__FILE__));
> + }
> +}

You must pass __LINE__ and __FILE__ as parameter to this function.

regards,
Philippe Elie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/