summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/config/Make.rules.Linux2
-rw-r--r--cpp/include/IceUtil/DisableWarnings.h14
-rw-r--r--cpp/src/IceGrid/ServerCache.cpp2
-rw-r--r--cpp/test/Freeze/complex/Scanner.cpp27
-rw-r--r--cpp/test/Freeze/complex/Scanner.l5
-rw-r--r--cpp/test/Ice/background/EndpointI.cpp4
-rw-r--r--cpp/test/Ice/hash/Client.cpp4
-rw-r--r--cpp/test/Ice/operations/Twoways.cpp7
-rw-r--r--cpp/test/Ice/operations/TwowaysAMI.cpp7
-rw-r--r--cpp/test/Ice/operations/TwowaysNewAMI.cpp7
-rw-r--r--php/config/Make.rules.Linux22
-rw-r--r--py/config/Make.rules.Linux23
-rw-r--r--py/modules/IcePy/Connection.cpp2
-rw-r--r--py/modules/IcePy/Endpoint.cpp2
-rw-r--r--py/modules/IcePy/ImplicitContext.cpp2
-rw-r--r--py/modules/IcePy/Proxy.cpp2
-rw-r--r--rb/src/IceRuby/Proxy.cpp2
17 files changed, 116 insertions, 18 deletions
diff --git a/cpp/config/Make.rules.Linux b/cpp/config/Make.rules.Linux
index 269fea15a03..b6a92b93294 100644
--- a/cpp/config/Make.rules.Linux
+++ b/cpp/config/Make.rules.Linux
@@ -79,7 +79,7 @@ ifeq ($(CXX),g++)
endif
endif
- CXXFLAGS = $(CXXARCHFLAGS) -Wall -D_REENTRANT
+ CXXFLAGS = $(CXXARCHFLAGS) -Wall -Werror -D_REENTRANT
ifneq ($(GENPIC),no)
CXXFLAGS += -fPIC
diff --git a/cpp/include/IceUtil/DisableWarnings.h b/cpp/include/IceUtil/DisableWarnings.h
index 184961a0ac4..45218dae4ed 100644
--- a/cpp/include/IceUtil/DisableWarnings.h
+++ b/cpp/include/IceUtil/DisableWarnings.h
@@ -11,7 +11,7 @@
#define ICE_UTIL_DISABLEWARNINGS_H
//
-// This header file disables various annoying compiler warnings that
+// This header file disables or makes non-fatal various compiler warnings that
// we don't want.
//
// IMPORTANT: Do *not* include this header file in another public header file!
@@ -20,6 +20,9 @@
// header file in Ice *source* files!
//
+//
+// Microsoft Visual C++
+//
#if defined(_MSC_VER)
# define _CRT_SECURE_NO_DEPRECATE 1 // C4996 '<C function>' was declared deprecated/
# pragma warning( 4 : 4996 ) // C4996 'std::<function>' was declared deprecated
@@ -30,4 +33,13 @@
# endif
#endif
+
+//
+// GCC
+//
+#if defined(__GNUC__)
+# pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#endif
+
+
#endif
diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp
index d05fb627dc6..62529899de0 100644
--- a/cpp/src/IceGrid/ServerCache.cpp
+++ b/cpp/src/IceGrid/ServerCache.cpp
@@ -561,7 +561,7 @@ ServerEntry::syncImpl()
SessionIPtr session;
ServerInfo destroy;
int timeout = -1;
- bool noRestart;
+ bool noRestart = false;
{
Lock sync(*this);
diff --git a/cpp/test/Freeze/complex/Scanner.cpp b/cpp/test/Freeze/complex/Scanner.cpp
index a3f371f18bc..02621eabd56 100644
--- a/cpp/test/Freeze/complex/Scanner.cpp
+++ b/cpp/test/Freeze/complex/Scanner.cpp
@@ -482,6 +482,11 @@ char *yytext;
# pragma warning( 4 : 4244 )
#endif
+#if defined(__GNUC__)
+# pragma GCC diagnostic warning "-Wunused-function"
+#endif
+
+
using namespace std;
using namespace Ice;
@@ -505,7 +510,7 @@ using namespace Ice;
#define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize)
-#line 508 "lex.yy.c"
+#line 513 "lex.yy.c"
#define INITIAL 0
@@ -594,7 +599,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -605,7 +610,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- int n; \
+ unsigned n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -687,10 +692,10 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 62 "Scanner.l"
+#line 67 "Scanner.l"
-#line 693 "lex.yy.c"
+#line 698 "lex.yy.c"
if ( !(yy_init) )
{
@@ -771,7 +776,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 64 "Scanner.l"
+#line 69 "Scanner.l"
{
*yylvalp = new Complex::NumberNodeI(atoi(yytext));
return TOK_NUMBER;
@@ -779,20 +784,20 @@ YY_RULE_SETUP
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 69 "Scanner.l"
+#line 74 "Scanner.l"
/* eat whitespace */
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 71 "Scanner.l"
+#line 76 "Scanner.l"
{ return *yytext; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 73 "Scanner.l"
+#line 78 "Scanner.l"
ECHO;
YY_BREAK
-#line 795 "lex.yy.c"
+#line 800 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1787,7 +1792,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 73 "Scanner.l"
+#line 78 "Scanner.l"
diff --git a/cpp/test/Freeze/complex/Scanner.l b/cpp/test/Freeze/complex/Scanner.l
index 4461779e8df..f52249c7262 100644
--- a/cpp/test/Freeze/complex/Scanner.l
+++ b/cpp/test/Freeze/complex/Scanner.l
@@ -27,6 +27,11 @@
# pragma warning( 4 : 4244 )
#endif
+#if defined(__GNUC__)
+# pragma GCC diagnostic warning "-Wunused-function"
+#endif
+
+
using namespace std;
using namespace Ice;
diff --git a/cpp/test/Ice/background/EndpointI.cpp b/cpp/test/Ice/background/EndpointI.cpp
index c1f872691db..52e2a23e513 100644
--- a/cpp/test/Ice/background/EndpointI.cpp
+++ b/cpp/test/Ice/background/EndpointI.cpp
@@ -18,6 +18,10 @@
#pragma warning( disable : 4996 )
#endif
+#if defined(__GNUC__)
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
using namespace std;
Ice::Short EndpointI::TYPE_BASE = 100;
diff --git a/cpp/test/Ice/hash/Client.cpp b/cpp/test/Ice/hash/Client.cpp
index 4bdd32591a7..520e946b7f5 100644
--- a/cpp/test/Ice/hash/Client.cpp
+++ b/cpp/test/Ice/hash/Client.cpp
@@ -17,6 +17,10 @@
#pragma warning( disable : 4996 )
#endif
+#if defined(__GNUC__)
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
using namespace std;
using namespace Test;
diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp
index d59e18810d8..bfdff90c137 100644
--- a/cpp/test/Ice/operations/Twoways.cpp
+++ b/cpp/test/Ice/operations/Twoways.cpp
@@ -22,6 +22,13 @@
# undef max
#endif
+//
+// Work-around for GCC warning bug
+//
+#if defined(__GNUC__)
+# pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif
+
using namespace std;
namespace
diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp
index 5e1c54e6df5..525da24d6b7 100644
--- a/cpp/test/Ice/operations/TwowaysAMI.cpp
+++ b/cpp/test/Ice/operations/TwowaysAMI.cpp
@@ -12,6 +12,13 @@
#include <Test.h>
#include <limits>
+//
+// Work-around for GCC warning bug
+//
+#if defined(__GNUC__)
+# pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif
+
using namespace std;
namespace
diff --git a/cpp/test/Ice/operations/TwowaysNewAMI.cpp b/cpp/test/Ice/operations/TwowaysNewAMI.cpp
index 212bc12d6fd..647cc58c032 100644
--- a/cpp/test/Ice/operations/TwowaysNewAMI.cpp
+++ b/cpp/test/Ice/operations/TwowaysNewAMI.cpp
@@ -11,6 +11,13 @@
#include <TestCommon.h>
#include <Test.h>
+//
+// Work-around for GCC warning bug
+//
+#if defined(__GNUC__)
+# pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif
+
using namespace std;
namespace
diff --git a/php/config/Make.rules.Linux b/php/config/Make.rules.Linux
new file mode 100644
index 00000000000..4d4b95ed985
--- /dev/null
+++ b/php/config/Make.rules.Linux
@@ -0,0 +1,22 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+#
+# This file is itself included by Make.rules
+#
+
+include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME)
+
+ifeq ($(CXX),g++)
+
+ #
+ # TODO: fix warning in code
+ #
+ CXXFLAGS += -Wno-error=write-strings
+endif
diff --git a/py/config/Make.rules.Linux b/py/config/Make.rules.Linux
new file mode 100644
index 00000000000..969addd54a4
--- /dev/null
+++ b/py/config/Make.rules.Linux
@@ -0,0 +1,23 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+#
+# This file is itself included by Make.rules
+#
+
+include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME)
+
+ifeq ($(CXX),g++)
+ ifeq ($(OPTIMIZE),yes)
+ #
+ # TODO: this is only need for Python < 3.x
+ #
+ CXXFLAGS += -fno-strict-aliasing
+ endif
+endif
diff --git a/py/modules/IcePy/Connection.cpp b/py/modules/IcePy/Connection.cpp
index 67e93114f85..1cb84c4271e 100644
--- a/py/modules/IcePy/Connection.cpp
+++ b/py/modules/IcePy/Connection.cpp
@@ -72,7 +72,7 @@ extern "C"
static PyObject*
connectionCompare(ConnectionObject* c1, PyObject* other, int op)
{
- bool result;
+ bool result = false;
if(PyObject_TypeCheck(other, &ConnectionType))
{
diff --git a/py/modules/IcePy/Endpoint.cpp b/py/modules/IcePy/Endpoint.cpp
index 314a163c5d1..8da02fe06bc 100644
--- a/py/modules/IcePy/Endpoint.cpp
+++ b/py/modules/IcePy/Endpoint.cpp
@@ -54,7 +54,7 @@ extern "C"
static PyObject*
endpointCompare(EndpointObject* p1, PyObject* other, int op)
{
- bool result;
+ bool result = false;
if(PyObject_TypeCheck(other, &EndpointType))
{
diff --git a/py/modules/IcePy/ImplicitContext.cpp b/py/modules/IcePy/ImplicitContext.cpp
index ae503a10e58..23fad405720 100644
--- a/py/modules/IcePy/ImplicitContext.cpp
+++ b/py/modules/IcePy/ImplicitContext.cpp
@@ -63,7 +63,7 @@ extern "C"
static PyObject*
implicitContextCompare(ImplicitContextObject* c1, PyObject* other, int op)
{
- bool result;
+ bool result = false;
if(PyObject_TypeCheck(other, &ImplicitContextType))
{
diff --git a/py/modules/IcePy/Proxy.cpp b/py/modules/IcePy/Proxy.cpp
index 9e462cfd550..36d0d642254 100644
--- a/py/modules/IcePy/Proxy.cpp
+++ b/py/modules/IcePy/Proxy.cpp
@@ -96,7 +96,7 @@ extern "C"
static PyObject*
proxyCompare(ProxyObject* p1, PyObject* other, int op)
{
- bool result;
+ bool result = false;
if(PyObject_TypeCheck(other, &ProxyType))
{
diff --git a/rb/src/IceRuby/Proxy.cpp b/rb/src/IceRuby/Proxy.cpp
index 2452cd12506..545dcb9373c 100644
--- a/rb/src/IceRuby/Proxy.cpp
+++ b/rb/src/IceRuby/Proxy.cpp
@@ -7,6 +7,7 @@
//
// **********************************************************************
+#include <IceUtil/DisableWarnings.h>
#include <Proxy.h>
#include <Communicator.h>
#include <Connection.h>
@@ -17,6 +18,7 @@
#include <Ice/Proxy.h>
#include <Ice/Router.h>
+
using namespace std;
using namespace IceRuby;