diff options
author | Sam Gross <sgross@fb.com> | 2015-06-18 23:08:22 +0300 |
---|---|---|
committer | Sam Gross <sgross@fb.com> | 2015-06-19 00:14:27 +0300 |
commit | cd52230a89e9d33521e814a6d72505e0859523c5 (patch) | |
tree | b96ea360ec8074f1e687a3b746766715030b6cfd /torch | |
parent | bd526b36c25f0d0584147b4c5f272144d3b3937e (diff) |
Suppress unused function warnings
We include a luaL_setfuncs implementation for compatibility with Lua
5.1. This adds __attribute__((unused)) to the function to supress unused
function warnings in files where it is not used.
Diffstat (limited to 'torch')
-rw-r--r-- | torch/utils.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/torch/utils.h b/torch/utils.h index c8c9398..7e5a813 100644 --- a/torch/utils.h +++ b/torch/utils.h @@ -10,6 +10,12 @@ # define TORCH_EXTERNC extern #endif +#ifdef __GNUC__ +# define TORCH_UNUSED __attribute__((unused)) +#else +# define TORCH_UNUSED +#endif + #ifdef WIN32 # ifdef torch_EXPORTS # define TORCH_API TORCH_EXTERNC __declspec(dllexport) @@ -24,7 +30,7 @@ /* ** Adapted from Lua 5.2.0 */ -static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { +TORCH_UNUSED static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup+1, "too many upvalues"); for (; l->name != NULL; l++) { /* fill the table with given functions */ int i; |