- Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix compiler warnings from GCC #3372
New issue
Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.
By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on ? Sign in to your account
base: v2/master
Are you sure you want to change the base?
Conversation
-Wall -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS Note, e.g. sprintf(digest, "%s%02x", digest, ...) is undefined behaviour because the destination and source variables overlap, and GCC warnings for this. acmp.c:258:13: warning: 'acmp_clone_node_no_state' defined but not used [-Wunused-function] apache2_config.c:806:9: warning: unused variable 'offset' [-Wunused-variable] apache2_config.c:1886:23: warning: unused variable 'dcfg' [-Wunused-variable] apache2_config.c:1942:23: warning: unused variable 'dcfg' [-Wunused-variable] apache2_config.c:2470:23: warning: unused variable 'dcfg' [-Wunused-variable] apache2_config.c:2538:23: warning: unused variable 'dcfg' [-Wunused-variable] apache2_util.c:226:11: warning: unused variable 'str' [-Wunused-variable] apache2_util.c:225:11: warning: unused variable 'saved' [-Wunused-variable] apache2_util.c:224:11: warning: unused variable 'parse_remote' [-Wunused-variable] apache2_util.c:223:11: warning: unused variable 'remote' [-Wunused-variable] msc_status_engine.c:216:17: warning: unused variable 'i' [-Wunused-variable] msc_status_engine.c:375:55: warning: the address of 'pcre' will always evaluate as 'true' [-Waddress] msc_crypt.c:67:17: warning: unused variable 'bytes' [-Wunused-variable] msc_crypt.c:1083:33: warning: variable 'enc' set but not used [-Wunused-but-set-variable] msc_crypt.c:1090:29: warning: variable 'enc' set but not used [-Wunused-but-set-variable] /usr/include/bits/stdio2.h:30:10: warning: '__sprintf_chk' argument 5 overlaps destination object 'digest' [-Wrestrict] msc_json.c:405:11: warning: unused variable 'json_data' [-Wunused-variable] msc_crypt.c:1097:79: warning: '%s' directive argument is null [-Wformat-overflow=] msc_logging.c:1144:20: warning: unused variable 'now' [-Wunused-variable] msc_remote_rules.c:729:19: warning: unused variable 'word' [-Wunused-variable] msc_remote_rules.c:727:17: warning: unused variable 'tmp' [-Wunused-variable] msc_remote_rules.c:805:1: warning: control reaches end of non-void function [-Wreturn-type] msc_tree.c:836:19: warning: unused variable 'ip' [-Wunused-variable] msc_xml.c:29:44: warning: variable 'entity' set but not used [-Wunused-but-set-variable] msc_util.c:2627:11: warning: unused variable 'start' [-Wunused-variable] msc_util.c:2626:17: warning: unused variable 'fd' [-Wunused-variable] msc_util.c:2624:18: warning: unused variable 'rc' [-Wunused-variable] msc_util.c:1077:19: warning: array subscript 1 is outside array bounds of 'unsigned char[1]' [-Warray-bounds=]
|
@@ -251,6 +251,7 @@ static void acmp_add_node_to_parent(acmp_node_t *parent, acmp_node_t *child) { | |||
} | |||
} | |||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. It seems like we don't use this function at all - do we want to keep this unused code?
@@ -132,29 +132,19 @@ static void msc_xml_on_characters(void *ctx, const xmlChar *ch, int len) { | |||
} | |||
static xmlParserInputBufferPtr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you removed this function because it always returned a NULL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is a mistake too. Since entity
was set but never used in xml_init I assumed this was safe to remove, but xmlParserInputBufferCreateFilenameDefault
should still be called here. I'll restore it and fix the warning another way.
@@ -4231,11 +4231,6 @@ static int msre_op_fuzzy_hash_init(msre_rule *rule, char **error_msg) | |||
return 1; | |||
#endif | |||
return 1; | |||
invalid_parameters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I missed that because I don't have that feature enabled. I'll restore this.
Hi @notroj, first of all, many thanks for this PR. There are some other warnings in different files (usually with different kind of warnings) - do you plan to fix those too? |
what
why
references