Re: Some Warning from gcc-3.4-cvs for 2.5.65

From: Jörn Engel (joern@wohnheim.fh-wedel.de)
Date: Fri Mar 21 2003 - 08:34:41 EST


On Fri, 21 March 2003 14:15:12 +0000, Norbert Wolff wrote:
>
> Here are some Warning got when compiling Linux 2.6.65 (devfs not configured)
> with the latest gcc-3.4 CVS :
>
> include/linux/devfs_fs_kernel.h: In function `devfs_remove':
> include/linux/devfs_fs_kernel.h:101: warning: varargs function cannot be
> inline
>
> Possible Fix :
>
> Replace inline-func with macro
>
> --- devfs_fs_kernel.h.orig 2003-03-21 13:28:24.000000000 +0000
> +++ devfs_fs_kernel.h 2003-03-21 13:30:28.000000000 +0000
> @@ -97,9 +97,9 @@
> {
> return NULL;
> }
> -static inline void devfs_remove(const char *fmt, ...)
> -{
> -}
> +
> +#define devfs_remove(x, ...) do { ; } while (0)
> +
> static inline int devfs_generate_path (devfs_handle_t de, char *path,
> int buflen)
> {
>
> ---
>
> include/linux/kallsyms.h: In function `__check_printsym_format':
> include/linux/kallsyms.h:38: warning: varargs function cannot be inline
>
> > /* This macro allows us to keep printk typechecking */
> > static void __check_printsym_format(const char *fmt, ...)
> >__attribute__((format(printf,1,2)));
> > static inline void __check_printsym_format(const char *fmt, ...)
> > {
> > }
>
> I think the inline-attribute should be simply removed to quiet this Warning.

Quiting a warning is not a good reason for patches. If the warning is
bogus, the compiler should get fixed, not the kernel.
In this case the compiler should, inlined or not, optimize the call to
an empty function into nothing and shut up.

Jörn

-- 
Good warriors cause others to come to them and do not go to others.
-- Sun Tzu
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:36 EST