Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
5cbd1f29
Unverified
Commit
5cbd1f29
authored
Jun 01, 2023
by
Yossi Gottlieb
Committed by
GitHub
Jun 01, 2023
Browse files
Add -Werror as a default. (#1193)
parent
af144563
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
5cbd1f29
...
@@ -39,7 +39,7 @@ export REDIS_TEST_CONFIG
...
@@ -39,7 +39,7 @@ export REDIS_TEST_CONFIG
CC
:=
$(
shell
sh
-c
'type $${CC%% *
}
>/dev/null 2>/dev/null && echo
$(CC)
|| echo gcc'
)
CC
:=
$(
shell
sh
-c
'type $${CC%% *
}
>/dev/null 2>/dev/null && echo
$(CC)
|| echo gcc'
)
CXX
:=
$(
shell
sh
-c
'type $${CXX%% *
}
>/dev/null 2>/dev/null && echo
$(CXX)
|| echo g++'
)
CXX
:=
$(
shell
sh
-c
'type $${CXX%% *
}
>/dev/null 2>/dev/null && echo
$(CXX)
|| echo g++'
)
OPTIMIZATION
?=
-O3
OPTIMIZATION
?=
-O3
WARNINGS
=
-Wall
-W
-Wstrict-prototypes
-Wwrite-strings
-Wno-missing-field-initializers
WARNINGS
=
-Wall
-W
extra
-Werror
-Wstrict-prototypes
-Wwrite-strings
-Wno-missing-field-initializers
DEBUG_FLAGS
?=
-g
-ggdb
DEBUG_FLAGS
?=
-g
-ggdb
REAL_CFLAGS
=
$(OPTIMIZATION)
-fPIC
$(CPPFLAGS)
$(CFLAGS)
$(WARNINGS)
$(DEBUG_FLAGS)
$(PLATFORM_FLAGS)
REAL_CFLAGS
=
$(OPTIMIZATION)
-fPIC
$(CPPFLAGS)
$(CFLAGS)
$(WARNINGS)
$(DEBUG_FLAGS)
$(PLATFORM_FLAGS)
REAL_LDFLAGS
=
$(LDFLAGS)
REAL_LDFLAGS
=
$(LDFLAGS)
...
...
hiredis.c
View file @
5cbd1f29
...
@@ -392,12 +392,12 @@ int redisvFormatCommand(char **target, const char *format, va_list ap) {
...
@@ -392,12 +392,12 @@ int redisvFormatCommand(char **target, const char *format, va_list ap) {
while
(
*
_p
!=
'\0'
&&
strchr
(
flags
,
*
_p
)
!=
NULL
)
_p
++
;
while
(
*
_p
!=
'\0'
&&
strchr
(
flags
,
*
_p
)
!=
NULL
)
_p
++
;
/* Field width */
/* Field width */
while
(
*
_p
!=
'\0'
&&
isdigit
(
*
_p
))
_p
++
;
while
(
*
_p
!=
'\0'
&&
isdigit
(
(
int
)
*
_p
))
_p
++
;
/* Precision */
/* Precision */
if
(
*
_p
==
'.'
)
{
if
(
*
_p
==
'.'
)
{
_p
++
;
_p
++
;
while
(
*
_p
!=
'\0'
&&
isdigit
(
*
_p
))
_p
++
;
while
(
*
_p
!=
'\0'
&&
isdigit
(
(
int
)
*
_p
))
_p
++
;
}
}
/* Copy va_list before consuming with va_arg */
/* Copy va_list before consuming with va_arg */
...
...
sds.c
View file @
5cbd1f29
...
@@ -886,7 +886,7 @@ sds sdscatrepr(sds s, const char *p, size_t len) {
...
@@ -886,7 +886,7 @@ sds sdscatrepr(sds s, const char *p, size_t len) {
case
'\a'
:
s
=
sdscatlen
(
s
,
"
\\
a"
,
2
);
break
;
case
'\a'
:
s
=
sdscatlen
(
s
,
"
\\
a"
,
2
);
break
;
case
'\b'
:
s
=
sdscatlen
(
s
,
"
\\
b"
,
2
);
break
;
case
'\b'
:
s
=
sdscatlen
(
s
,
"
\\
b"
,
2
);
break
;
default:
default:
if
(
isprint
(
*
p
))
if
(
isprint
(
(
int
)
*
p
))
s
=
sdscatprintf
(
s
,
"%c"
,
*
p
);
s
=
sdscatprintf
(
s
,
"%c"
,
*
p
);
else
else
s
=
sdscatprintf
(
s
,
"
\\
x%02x"
,(
unsigned
char
)
*
p
);
s
=
sdscatprintf
(
s
,
"
\\
x%02x"
,(
unsigned
char
)
*
p
);
...
@@ -948,7 +948,7 @@ sds *sdssplitargs(const char *line, int *argc) {
...
@@ -948,7 +948,7 @@ sds *sdssplitargs(const char *line, int *argc) {
*
argc
=
0
;
*
argc
=
0
;
while
(
1
)
{
while
(
1
)
{
/* skip blanks */
/* skip blanks */
while
(
*
p
&&
isspace
(
*
p
))
p
++
;
while
(
*
p
&&
isspace
(
(
int
)
*
p
))
p
++
;
if
(
*
p
)
{
if
(
*
p
)
{
/* get a token */
/* get a token */
int
inq
=
0
;
/* set to 1 if we are in "quotes" */
int
inq
=
0
;
/* set to 1 if we are in "quotes" */
...
@@ -959,8 +959,8 @@ sds *sdssplitargs(const char *line, int *argc) {
...
@@ -959,8 +959,8 @@ sds *sdssplitargs(const char *line, int *argc) {
while
(
!
done
)
{
while
(
!
done
)
{
if
(
inq
)
{
if
(
inq
)
{
if
(
*
p
==
'\\'
&&
*
(
p
+
1
)
==
'x'
&&
if
(
*
p
==
'\\'
&&
*
(
p
+
1
)
==
'x'
&&
isxdigit
(
*
(
p
+
2
))
&&
isxdigit
(
(
int
)
*
(
p
+
2
))
&&
isxdigit
(
*
(
p
+
3
)))
isxdigit
(
(
int
)
*
(
p
+
3
)))
{
{
unsigned
char
byte
;
unsigned
char
byte
;
...
@@ -984,7 +984,7 @@ sds *sdssplitargs(const char *line, int *argc) {
...
@@ -984,7 +984,7 @@ sds *sdssplitargs(const char *line, int *argc) {
}
else
if
(
*
p
==
'"'
)
{
}
else
if
(
*
p
==
'"'
)
{
/* closing quote must be followed by a space or
/* closing quote must be followed by a space or
* nothing at all. */
* nothing at all. */
if
(
*
(
p
+
1
)
&&
!
isspace
(
*
(
p
+
1
)))
goto
err
;
if
(
*
(
p
+
1
)
&&
!
isspace
(
(
int
)
*
(
p
+
1
)))
goto
err
;
done
=
1
;
done
=
1
;
}
else
if
(
!*
p
)
{
}
else
if
(
!*
p
)
{
/* unterminated quotes */
/* unterminated quotes */
...
@@ -999,7 +999,7 @@ sds *sdssplitargs(const char *line, int *argc) {
...
@@ -999,7 +999,7 @@ sds *sdssplitargs(const char *line, int *argc) {
}
else
if
(
*
p
==
'\''
)
{
}
else
if
(
*
p
==
'\''
)
{
/* closing quote must be followed by a space or
/* closing quote must be followed by a space or
* nothing at all. */
* nothing at all. */
if
(
*
(
p
+
1
)
&&
!
isspace
(
*
(
p
+
1
)))
goto
err
;
if
(
*
(
p
+
1
)
&&
!
isspace
(
(
int
)
*
(
p
+
1
)))
goto
err
;
done
=
1
;
done
=
1
;
}
else
if
(
!*
p
)
{
}
else
if
(
!*
p
)
{
/* unterminated quotes */
/* unterminated quotes */
...
...
test.c
View file @
5cbd1f29
...
@@ -1567,6 +1567,9 @@ static void test_throughput(struct config config) {
...
@@ -1567,6 +1567,9 @@ static void test_throughput(struct config config) {
// }
// }
#ifdef HIREDIS_TEST_ASYNC
#ifdef HIREDIS_TEST_ASYNC
#pragma GCC diagnostic ignored "-Woverlength-strings"
/* required on gcc 4.8.x due to assert statements */
struct
event_base
*
base
;
struct
event_base
*
base
;
typedef
struct
TestState
{
typedef
struct
TestState
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment