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

Geert Uytterhoeven
2004-02-02T21:11:03Z

On Mon, 2 Feb 2004, Kronos wrote:
> siimage.c:65: warning: control reaches end of non-void function
>
> The last statement before the end is BUG(), but I added a return to
> silence the warning.
>
> diff -Nru -X dontdiff linux-2.4-vanilla/drivers/ide/pci/siimage.c linux-2.4/drivers/ide/pci/siimage.c
> --- linux-2.4-vanilla/drivers/ide/pci/siimage.c Tue Nov 11 17:51:38 2003
> +++ linux-2.4/drivers/ide/pci/siimage.c Sat Jan 31 19:07:56 2004
> @@ -62,6 +62,9 @@
> return 0;
> }
> BUG();
> +
> + /* gcc will complain */
> + return 0;
> }

What about adding `attribute ((noreturn))' to the declaration of BUG() instead?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds