Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cutorch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/torch
diff options
context:
space:
mode:
authorSam Gross <sgross@fb.com>2015-06-18 23:08:22 +0300
committerSam Gross <sgross@fb.com>2015-06-19 00:14:27 +0300
commitcd52230a89e9d33521e814a6d72505e0859523c5 (patch)
treeb96ea360ec8074f1e687a3b746766715030b6cfd /torch
parentbd526b36c25f0d0584147b4c5f272144d3b3937e (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.h8
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;