Skip to content

Commit b4d1d79

Browse files
authored
Merge pull request #133 from moteus/unused_warning
Fix. Compile time warnings about unused var/typdefs
2 parents 185a03e + e15f7d2 commit b4d1d79

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/lceasy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static int lcurl_easy_cleanup(lua_State *L){
124124
int i;
125125

126126
if(p->multi){
127-
CURLMcode code = lcurl__multi_remove_handle(L, p->multi, p);
127+
LCURL_UNUSED_VAR CURLMcode code = lcurl__multi_remove_handle(L, p->multi, p);
128128

129129
//! @todo what I can do if I can not remove it???
130130
}

src/lcutils.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@
2525
# define LCURL_CC_SUPPORT_FORWARD_TYPEDEF 0
2626
#endif
2727

28+
#ifdef __GNUC__
29+
#define LCURL_UNUSED_TYPEDEF __attribute__ ((unused))
30+
#else
31+
#define LCURL_UNUSED_TYPEDEF
32+
#endif
33+
34+
#define LCURL_UNUSED_VAR LCURL_UNUSED_TYPEDEF
35+
2836
#define LCURL_MAKE_VERSION(MIN, MAJ, PAT) ((MIN<<16) + (MAJ<<8) + PAT)
2937
#define LCURL_CURL_VER_GE(MIN, MAJ, PAT) (LIBCURL_VERSION_NUM >= LCURL_MAKE_VERSION(MIN, MAJ, PAT))
3038

3139
#define LCURL_CONCAT_STATIC_ASSERT_IMPL_(x, y) LCURL_CONCAT1_STATIC_ASSERT_IMPL_ (x, y)
32-
#define LCURL_CONCAT1_STATIC_ASSERT_IMPL_(x, y) x##y
40+
#define LCURL_CONCAT1_STATIC_ASSERT_IMPL_(x, y) LCURL_UNUSED_TYPEDEF x##y
3341
#define LCURL_STATIC_ASSERT(expr) typedef char LCURL_CONCAT_STATIC_ASSERT_IMPL_(static_assert_failed_at_line_, __LINE__) [(expr) ? 1 : -1]
3442

3543
#define LCURL_ASSERT_SAME_SIZE(a, b) LCURL_STATIC_ASSERT( sizeof(a) == sizeof(b) )

0 commit comments

Comments
 (0)