LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cvicc pragmas

Hello all,
I would like to suppress the warnings I get when compiling some of my macros
containing printf:
warning: too few arguments for format
warning: too many arguments for format

I use cvicc for linux, and the underlying compiler is, I believe, gcc.
But if I insert:
#pragma GCC diagnostic ignored "-Wno-format-extra-args"
#pragma GCC diagnostic warning "-Wno-format-extra-args"
around the section where I want to suppress the warnings (as per
http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html), I get the
following:
DimPpcServer.c:1079: warning: ignoring #pragma GCC diagnostic

So, how can I suppress those warnings ?
Thanks
--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 1 of 2
(3,389 Views)

Guillaume,

 

Looks like that warning might not be one that can be changed via pragma (the link you pointed to seems to suggest that not all warnings can be changed via pragma). Have you tried toggling "-Wformat" instead? According to the gcc documentation the extra args warning is only reported if you have -Wformat or -Wall enabled.

 

Luis

0 Kudos
Message 2 of 2
(3,363 Views)