* [viro-vfs:work.fd 28/39] include/linux/cleanup.h:111:21: error: function declaration isn't a prototype
@ 2024-07-29 15:07 kernel test robot
2024-07-29 20:45 ` Al Viro
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-07-29 15:07 UTC (permalink / raw)
To: Al Viro; +Cc: oe-kbuild-all, linux-fsdevel
tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.fd
head: 154eb19a802fdf8629273d414dbeb31eccb61587
commit: a5027b86a79716e98fe0b8e1247743dfb5a5c080 [28/39] switch spufs_calls_{get,put}() to CLASS() use
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20240729/202407292309.QXlzRsZS-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240729/202407292309.QXlzRsZS-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407292309.QXlzRsZS-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/file.h:14,
from arch/powerpc/platforms/cell/spu_syscalls.c:10:
>> include/linux/cleanup.h:111:21: error: function declaration isn't a prototype [-Werror=strict-prototypes]
111 | static inline _type class_##_name##_constructor(_init_args) \
| ^~~~~~
arch/powerpc/platforms/cell/spu_syscalls.c:59:1: note: in expansion of macro 'DEFINE_CLASS'
59 | DEFINE_CLASS(spufs_calls, struct spufs_calls *, spufs_calls_put(_T), spufs_calls_get())
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +111 include/linux/cleanup.h
54da6a0924311c Peter Zijlstra 2023-05-26 82
54da6a0924311c Peter Zijlstra 2023-05-26 83
54da6a0924311c Peter Zijlstra 2023-05-26 84 /*
54da6a0924311c Peter Zijlstra 2023-05-26 85 * DEFINE_CLASS(name, type, exit, init, init_args...):
54da6a0924311c Peter Zijlstra 2023-05-26 86 * helper to define the destructor and constructor for a type.
54da6a0924311c Peter Zijlstra 2023-05-26 87 * @exit is an expression using '_T' -- similar to FREE above.
54da6a0924311c Peter Zijlstra 2023-05-26 88 * @init is an expression in @init_args resulting in @type
54da6a0924311c Peter Zijlstra 2023-05-26 89 *
54da6a0924311c Peter Zijlstra 2023-05-26 90 * EXTEND_CLASS(name, ext, init, init_args...):
54da6a0924311c Peter Zijlstra 2023-05-26 91 * extends class @name to @name@ext with the new constructor
54da6a0924311c Peter Zijlstra 2023-05-26 92 *
54da6a0924311c Peter Zijlstra 2023-05-26 93 * CLASS(name, var)(args...):
54da6a0924311c Peter Zijlstra 2023-05-26 94 * declare the variable @var as an instance of the named class
54da6a0924311c Peter Zijlstra 2023-05-26 95 *
54da6a0924311c Peter Zijlstra 2023-05-26 96 * Ex.
54da6a0924311c Peter Zijlstra 2023-05-26 97 *
54da6a0924311c Peter Zijlstra 2023-05-26 98 * DEFINE_CLASS(fdget, struct fd, fdput(_T), fdget(fd), int fd)
54da6a0924311c Peter Zijlstra 2023-05-26 99 *
54da6a0924311c Peter Zijlstra 2023-05-26 100 * CLASS(fdget, f)(fd);
a825760957e3aa Al Viro 2024-05-31 101 * if (!fd_file(f))
54da6a0924311c Peter Zijlstra 2023-05-26 102 * return -EBADF;
54da6a0924311c Peter Zijlstra 2023-05-26 103 *
54da6a0924311c Peter Zijlstra 2023-05-26 104 * // use 'f' without concern
54da6a0924311c Peter Zijlstra 2023-05-26 105 */
54da6a0924311c Peter Zijlstra 2023-05-26 106
54da6a0924311c Peter Zijlstra 2023-05-26 107 #define DEFINE_CLASS(_name, _type, _exit, _init, _init_args...) \
54da6a0924311c Peter Zijlstra 2023-05-26 108 typedef _type class_##_name##_t; \
54da6a0924311c Peter Zijlstra 2023-05-26 109 static inline void class_##_name##_destructor(_type *p) \
54da6a0924311c Peter Zijlstra 2023-05-26 110 { _type _T = *p; _exit; } \
54da6a0924311c Peter Zijlstra 2023-05-26 @111 static inline _type class_##_name##_constructor(_init_args) \
54da6a0924311c Peter Zijlstra 2023-05-26 112 { _type t = _init; return t; }
54da6a0924311c Peter Zijlstra 2023-05-26 113
:::::: The code at line 111 was first introduced by commit
:::::: 54da6a0924311c7cf5015533991e44fb8eb12773 locking: Introduce __cleanup() based infrastructure
:::::: TO: Peter Zijlstra <peterz@infradead.org>
:::::: CC: Peter Zijlstra <peterz@infradead.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [viro-vfs:work.fd 28/39] include/linux/cleanup.h:111:21: error: function declaration isn't a prototype
2024-07-29 15:07 [viro-vfs:work.fd 28/39] include/linux/cleanup.h:111:21: error: function declaration isn't a prototype kernel test robot
@ 2024-07-29 20:45 ` Al Viro
0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2024-07-29 20:45 UTC (permalink / raw)
To: kernel test robot; +Cc: oe-kbuild-all, linux-fsdevel
On Mon, Jul 29, 2024 at 11:07:02PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.fd
> head: 154eb19a802fdf8629273d414dbeb31eccb61587
> commit: a5027b86a79716e98fe0b8e1247743dfb5a5c080 [28/39] switch spufs_calls_{get,put}() to CLASS() use
> config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20240729/202407292309.QXlzRsZS-lkp@intel.com/config)
> compiler: powerpc64-linux-gcc (GCC) 14.1.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240729/202407292309.QXlzRsZS-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202407292309.QXlzRsZS-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/file.h:14,
> from arch/powerpc/platforms/cell/spu_syscalls.c:10:
> >> include/linux/cleanup.h:111:21: error: function declaration isn't a prototype [-Werror=strict-prototypes]
> 111 | static inline _type class_##_name##_constructor(_init_args) \
> | ^~~~~~
> arch/powerpc/platforms/cell/spu_syscalls.c:59:1: note: in expansion of macro 'DEFINE_CLASS'
> 59 | DEFINE_CLASS(spufs_calls, struct spufs_calls *, spufs_calls_put(_T), spufs_calls_get())
> | ^~~~~~~~~~~~
> cc1: some warnings being treated as errors
Bollocks galore:
1) gcc does not catch e.g.
if (foo)
goto l;
void *p __free(kfree) = NULL;
...
l:
...
and quietly passes an uninitialized value to kfree(). clang catches that.
2) clang, OTOH, does not feel obliged to object against DEFINE_CLASS with
4 arguments and constructor that takes no arguments at all. gcc produces
the splat above...
Joy...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-29 20:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-29 15:07 [viro-vfs:work.fd 28/39] include/linux/cleanup.h:111:21: error: function declaration isn't a prototype kernel test robot
2024-07-29 20:45 ` Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).