From ea39f5facdb2e0ac05ad992d3bba0d529220b665 Mon Sep 17 00:00:00 2001
Message-Id: <ea39f5facdb2e0ac05ad992d3bba0d529220b665.1348585382.git.ibell@...>
In-Reply-To: <e0560b414fba376587f5a172a8bece82b56e4508.1348585382.git.ibell@...>
References: <e0560b414fba376587f5a172a8bece82b56e4508.1348585382.git.ibell@...>
From: Ian Bell <ibell@...>
Date: Tue, 25 Sep 2012 14:49:52 +0100
Subject: [PATCH 2/2] CPP warning fixes
Tightened up the compiler flags and fixed some warnings. The tighter
flags should help prevent some common cross platform issues.
Signed-off-by: Ian Bell <ibell@...>
---
mama/c_cpp/src/cpp/Makefile.am | 4 ++--
mama/c_cpp/src/cpp/mama/MamaQueueEventCallback.h | 2 ++
mama/c_cpp/src/cpp/mama/MamaTimer.h | 1 +
mama/c_cpp/src/cpp/mamacpp.cpp | 4 ++--
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/mama/c_cpp/src/cpp/Makefile.am b/mama/c_cpp/src/cpp/Makefile.am
index 47857ad..0f73c58 100644
--- a/mama/c_cpp/src/cpp/Makefile.am
+++ b/mama/c_cpp/src/cpp/Makefile.am
@@ -103,8 +103,8 @@ LDFLAGS += -I@srcdir@/../c \
-L@builddir@/../c
if USE_GCC_FLAGS
-CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
-CPPFLAGS += -pedantic -Wall -Wimplicit -Wno-long-long -D_GNU_SOURCE
+CFLAGS += -std=gnu99 -pedantic-errors -Wmissing-prototypes -Wstrict-prototypes
+CPPFLAGS += -pedantic-errors -Wall -Wno-long-long -D_GNU_SOURCE
endif
libmamacpp_la_SOURCES = \
diff --git a/mama/c_cpp/src/cpp/mama/MamaQueueEventCallback.h b/mama/c_cpp/src/cpp/mama/MamaQueueEventCallback.h
index 41e285d..0195a48 100644
--- a/mama/c_cpp/src/cpp/mama/MamaQueueEventCallback.h
+++ b/mama/c_cpp/src/cpp/mama/MamaQueueEventCallback.h
@@ -25,6 +25,8 @@
namespace Wombat
{
+ class MamaQueue;
+
/**
* Definition of the callback method for when a user added event fires.
* Concrete instances of this interface are registered with an
diff --git a/mama/c_cpp/src/cpp/mama/MamaTimer.h b/mama/c_cpp/src/cpp/mama/MamaTimer.h
index 479e4e3..5a37400 100644
--- a/mama/c_cpp/src/cpp/mama/MamaTimer.h
+++ b/mama/c_cpp/src/cpp/mama/MamaTimer.h
@@ -26,6 +26,7 @@
namespace Wombat
{
+ class MamaTimerCallback;
/**
* A repeating timer. The callback will be repeatedly called at the
diff --git a/mama/c_cpp/src/cpp/mamacpp.cpp b/mama/c_cpp/src/cpp/mamacpp.cpp
index 7582ea2..ddfd3a0 100644
--- a/mama/c_cpp/src/cpp/mamacpp.cpp
+++ b/mama/c_cpp/src/cpp/mamacpp.cpp
@@ -60,7 +60,7 @@ namespace Wombat
void Mama::open()
{
// Open MAMA
- mama_status status = mamaTry (mama_open ());
+ mamaTry (mama_open ());
MamaReservedFields::initReservedFields();
}
@@ -69,7 +69,7 @@ namespace Wombat
const char* filename)
{
// Open MAMA
- mama_status status = mamaTry (mama_openWithProperties (path, filename));
+ mamaTry (mama_openWithProperties (path, filename));
MamaReservedFields::initReservedFields();
}
--
1.7.9.5