This article describes how to remove a warning locally in Visual Studio: http://msdn.microsoft.com/en-us/library/2c8f766e(v=vs.110).aspx
Essentially, the following pattern can be used (guarded by appropriate macros checking that the code is compiled by the Visual Studio): #pragma warning( push ) #pragma warning( disable : 4505 ) // The code of the function #pragma warning( pop ) Regards, Victor. > -----Original Message----- > From: victor khomenko > Sent: Monday, April 08, 2013 6:30 PM > To: 'Akim Demaille' > Cc: '[email protected]' > Subject: RE: __attribute__((__unused__)) problem > > Dear Akim, > > The error is gone, but the following warning has appeared instead (the code > emitted by bison is below): > > warning C4505: 'yy_location_print_' : unreferenced local function has been > removed > > Also, note the bizarre test > > # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL > > Regards, > Victor. > > -------------- > > #ifndef YY_LOCATION_PRINT > # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL > > /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ > > __attribute__((__unused__)) > #if (defined __STDC__ || defined __C99__FUNC__ \ > || defined __cplusplus || defined _MSC_VER) static unsigned > yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) #else static > unsigned yy_location_print_ (yyo, yylocp) > FILE *yyo; > YYLTYPE const * const yylocp; > #endif > { > ... > } > > # define YY_LOCATION_PRINT(File, Loc) \ > yy_location_print_ (File, &(Loc)) > > # else > # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif
