Skip to content

Fix implicit declaration of 'strncasecmp'#1

Open
tstellar wants to merge 1 commit into
goodform:masterfrom
tstellar:c99
Open

Fix implicit declaration of 'strncasecmp'#1
tstellar wants to merge 1 commit into
goodform:masterfrom
tstellar:c99

Conversation

@tstellar
Copy link
Copy Markdown

strncasecmp is declared in strings.h but the strings.h file included with the project was being included instead of strings.h from glibc.

@fweimer-rh
Copy link
Copy Markdown

I think changing the -I path is cleaner (do all compilers support -iquote)?

diff --git a/src/Makefile b/src/Makefile
index 0d37e9f..bee0988 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -16,7 +16,7 @@ endif
 
 # Find the OS
 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
-INCLUDE_DIRS = -I"$(RM_INCLUDE_DIR)" -I"$(DEPS_DIR)/jsonsl"  -I"$(DEPS_DIR)/RedisModuleSDK/rmutil"
+INCLUDE_DIRS = -I"$(RM_INCLUDE_DIR)" -I"$(DEPS_DIR)/jsonsl" -I"$(DEPS_DIR)/RedisModuleSDK"
 CFLAGS = $(INCLUDE_DIRS) -Wall $(DEBUGFLAGS) -fPIC -std=gnu99  -D_GNU_SOURCE
 CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
 

And then change the few places from <sds.h> to "rmutil/sds.h". No changes with the rmutil subdirectory (or anything else under deps/) are required. This avoids potential further shadowing.

strncasecmp is declared in strings.h but the strings.h file included
with the project was being included instead of strings.h from glibc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants