[Oisf-devel] [PATCH 7/8] gcc warning fixes.

Eric Leblond eleblond at edenwall.com
Mon Jan 11 10:11:37 UTC 2010


This patch fixes gcc warning:
    warning: suggest braces around empty body in an ‘if’ statement
This was the case in  when the macro SCLogDebug was used:
    if (ssn != NULL)
        SCLogDebug("ssn->alproto %"PRIu16"", ssn->alproto);

It also fixes a signed-unsigned comparison.
---
 src/runmodes.c   |    2 +-
 src/util-debug.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/runmodes.c b/src/runmodes.c
index 8bfbffd..dfb3e38 100644
--- a/src/runmodes.c
+++ b/src/runmodes.c
@@ -85,7 +85,7 @@ struct AlertOutput {
 struct AlertOutput *
 GetAlertOutputByName(char *name)
 {
-    int i;
+    unsigned int i;
 
     for (i = 0; i < sizeof(alert_descriptor)/sizeof(alert_descriptor[0]); i++) {
         if (strcmp(alert_descriptor[i].shortname, name) == 0)
diff --git a/src/util-debug.h b/src/util-debug.h
index 97317b1..65658f3 100644
--- a/src/util-debug.h
+++ b/src/util-debug.h
@@ -285,7 +285,7 @@ extern int sc_log_module_cleaned;
 /* Avoid the overhead of using the debugging subsystem, in production mode */
 #ifndef DEBUG
 
-#define SCLogDebug(...)
+#define SCLogDebug(...)                 do { } while (0)
 
 #define SCEnter(...)
 
-- 
1.6.6



More information about the Oisf-devel mailing list