summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-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
10 files changed, 65 insertions, 14 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