[PATCH 00/21] use portable variadic macros
Andre Muezerie
andremue at linux.microsoft.com
Wed Dec 11 22:35:33 CET 2024
On Tue, Dec 10, 2024 at 07:14:56PM -0800, Stephen Hemminger wrote:
> On Tue, 10 Dec 2024 18:05:30 -0800
> Andre Muezerie <andremue at linux.microsoft.com> wrote:
>
> > 1) Use portable variadic macros
> >
> > Many places are using a GCC extension related to variadic macros,
> > where a name prepends the ellipsis. This results in a warning like
> > the one below when compiling the code with MSVC:
> >
> > app\test-pmd\testpmd.h(1314): error C2608:
> > invalid token '...' in macro parameter list
> >
> > Variadic macros became a standard part of the C language with C99.
> > GCC, Clang and MSVC handle them properly.
> >
> > The fix is to remove the prefix name (args... becomes ...) and use
> > __VA_ARGS__.
>
> Could you add a coccinelle script and/or a checkpatch check to
> make sure that there are no new usages of ellipsis arg to deal with?
There is already a test for this in checkpatches.sh. Its message is:
MESSAGE='Do not use variadic argument pack in macros'
This test was probably added after these instances were written.
More information about the dev
mailing list