Message ID | 1351162111-31669-2-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 10/25/2012 06:48 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > I'm hoping to use -Wextra in the near future to ensure code quality > is high. Some of the fwts functions such as callbacks and fwts library > helper functions take arguments that we ignore. To hint to gcc that > we're really ignoring these and to stop -Wextra breaking I'm adding > FWTS_UNUSED() to explicitly tell us that the argument is meant to be > ignored. > > Example: > > void fwts_somefunc(fwts_framework *fw, int dummy) { > /* variable declarations here */ > > FWTS_IGNORED(dummy); > > /* start of executable statements here */ > .. > } > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/include/fwts.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/lib/include/fwts.h b/src/lib/include/fwts.h > index a1e0fd2..b8d0670 100644 > --- a/src/lib/include/fwts.h > +++ b/src/lib/include/fwts.h > @@ -24,6 +24,8 @@ > #define FWTS_ARCH_INTEL 1 > #endif > > +#define FWTS_UNUSED(var) (void)var > + > #define FWTS_JSON_DATA_PATH "/usr/share/fwts" > > #include "fwts_version.h" > Acked-by: Alex Hung <alex.hung@canonical.com>
On 10/25/2012 06:48 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > I'm hoping to use -Wextra in the near future to ensure code quality > is high. Some of the fwts functions such as callbacks and fwts library > helper functions take arguments that we ignore. To hint to gcc that > we're really ignoring these and to stop -Wextra breaking I'm adding > FWTS_UNUSED() to explicitly tell us that the argument is meant to be > ignored. > > Example: > > void fwts_somefunc(fwts_framework *fw, int dummy) { > /* variable declarations here */ > > FWTS_IGNORED(dummy); > > /* start of executable statements here */ > .. > } > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/include/fwts.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/lib/include/fwts.h b/src/lib/include/fwts.h > index a1e0fd2..b8d0670 100644 > --- a/src/lib/include/fwts.h > +++ b/src/lib/include/fwts.h > @@ -24,6 +24,8 @@ > #define FWTS_ARCH_INTEL 1 > #endif > > +#define FWTS_UNUSED(var) (void)var > + > #define FWTS_JSON_DATA_PATH "/usr/share/fwts" > > #include "fwts_version.h" > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/lib/include/fwts.h b/src/lib/include/fwts.h index a1e0fd2..b8d0670 100644 --- a/src/lib/include/fwts.h +++ b/src/lib/include/fwts.h @@ -24,6 +24,8 @@ #define FWTS_ARCH_INTEL 1 #endif +#define FWTS_UNUSED(var) (void)var + #define FWTS_JSON_DATA_PATH "/usr/share/fwts" #include "fwts_version.h"