bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: __attribute__((__unused__)) problem


From: victor khomenko
Subject: RE: __attribute__((__unused__)) problem
Date: Mon, 8 Apr 2013 19:03:12 +0000

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: 'address@hidden'
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]