From c9c426efd3e579d0220fbdee4a0a261fa2c191b5 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Fri, 7 Sep 2012 11:19:34 -0400 Subject: Port to Solaris 11 / Solaris Studio 12.3 (== CC 5.12) Fix to BasicStream.h (unitialized data member) that caused occasional failures in Ice/stream test --- cpp/src/FreezeScript/Scanner.cpp | 96 +++++++++++++++++------------------- cpp/src/FreezeScript/Scanner.l | 10 ++++ cpp/src/Glacier2Lib/Makefile | 2 +- cpp/src/Ice/ImplicitContextI.cpp | 51 ++++++++++--------- cpp/src/Ice/Network.cpp | 18 +++---- cpp/src/Ice/PropertyNames.cpp | 2 +- cpp/src/Ice/PropertyNames.h | 6 +-- cpp/src/Ice/Selector.cpp | 2 + cpp/src/Ice/StreamI.h | 8 +++ cpp/src/Ice/UdpTransceiver.cpp | 4 +- cpp/src/IceGrid/AdminI.cpp | 2 + cpp/src/IceGrid/AdminSessionI.cpp | 3 ++ cpp/src/IceGrid/DescriptorBuilder.h | 13 ++++- cpp/src/IceGrid/DescriptorHelper.cpp | 7 +++ cpp/src/IceGrid/DescriptorHelper.h | 2 +- cpp/src/IceGrid/Scanner.cpp | 60 +++++++++++----------- cpp/src/IceGrid/Scanner.l | 10 ++++ cpp/src/IcePatch2Lib/Util.cpp | 77 +---------------------------- cpp/src/IceSSL/Certificate.cpp | 16 ++++++ cpp/src/IceStorm/Observers.h | 9 ++++ cpp/src/IceStorm/Scanner.cpp | 60 +++++++++++----------- cpp/src/IceStorm/Scanner.l | 10 ++++ cpp/src/IceXML/Parser.cpp | 17 ++++--- cpp/src/Slice/Parser.cpp | 12 ----- cpp/src/Slice/Scanner.cpp | 84 +++++++++++++++---------------- cpp/src/Slice/Scanner.l | 10 ++++ cpp/src/Slice/Util.cpp | 2 +- cpp/src/slice2freezej/Main.cpp | 6 +++ cpp/src/slice2java/Gen.cpp | 15 ------ 29 files changed, 298 insertions(+), 316 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/FreezeScript/Scanner.cpp b/cpp/src/FreezeScript/Scanner.cpp index 6b9c34b3314..c759d4012bc 100644 --- a/cpp/src/FreezeScript/Scanner.cpp +++ b/cpp/src/FreezeScript/Scanner.cpp @@ -74,6 +74,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -104,8 +105,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -162,15 +161,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -563,6 +554,16 @@ char *freeze_script_text; # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef freeze_script_wrap +# undef freeze_script_wrap +# define freeze_script_wrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + using namespace std; using namespace FreezeScript; @@ -581,7 +582,7 @@ StringTokPtr parseString(char); #define YY_USER_INIT initScanner(); #define YY_INPUT(buf, result, max_size) { result = getInput(buf, max_size); } -#line 584 "lex.yy.c" +#line 585 "lex.yy.c" #define INITIAL 0 @@ -662,12 +663,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -675,7 +671,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 do { if (fwrite( freeze_script_text, freeze_script_leng, 1, freeze_script_out )) {} } while (0) +#define ECHO fwrite( freeze_script_text, freeze_script_leng, 1, freeze_script_out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -686,7 +682,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( freeze_script_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -768,10 +764,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 73 "Scanner.l" +#line 83 "Scanner.l" -#line 774 "lex.yy.c" +#line 770 "lex.yy.c" if ( !(yy_init) ) { @@ -852,7 +848,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 75 "Scanner.l" +#line 85 "Scanner.l" { // C++-style comment int c; @@ -869,7 +865,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 89 "Scanner.l" +#line 99 "Scanner.l" { // C-style comment while(true) @@ -901,7 +897,7 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 118 "Scanner.l" +#line 128 "Scanner.l" { StringTokPtr ident = new StringTok; ident->v = freeze_script_text; @@ -911,7 +907,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 125 "Scanner.l" +#line 135 "Scanner.l" { StringTokPtr str = parseString('"'); *yylvalp = str; @@ -920,7 +916,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 131 "Scanner.l" +#line 141 "Scanner.l" { StringTokPtr str = parseString('\''); *yylvalp = str; @@ -929,7 +925,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 137 "Scanner.l" +#line 147 "Scanner.l" { IntegerTokPtr itp = new IntegerTok; *yylvalp = itp; @@ -946,7 +942,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 151 "Scanner.l" +#line 161 "Scanner.l" { errno = 0; FloatingTokPtr ftp = new FloatingTok; @@ -978,7 +974,7 @@ YY_RULE_SETUP case 8: /* rule 8 can match eol */ YY_RULE_SETUP -#line 179 "Scanner.l" +#line 189 "Scanner.l" { // Igore white-space @@ -990,97 +986,97 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 188 "Scanner.l" +#line 198 "Scanner.l" return TOK_LESS_THAN; YY_BREAK case 10: YY_RULE_SETUP -#line 189 "Scanner.l" +#line 199 "Scanner.l" return TOK_GREATER_THAN; YY_BREAK case 11: YY_RULE_SETUP -#line 190 "Scanner.l" +#line 200 "Scanner.l" return TOK_LESS_EQUAL; YY_BREAK case 12: YY_RULE_SETUP -#line 191 "Scanner.l" +#line 201 "Scanner.l" return TOK_GREATER_EQUAL; YY_BREAK case 13: YY_RULE_SETUP -#line 192 "Scanner.l" +#line 202 "Scanner.l" return TOK_EQUAL; YY_BREAK case 14: YY_RULE_SETUP -#line 193 "Scanner.l" +#line 203 "Scanner.l" return TOK_NEQ; YY_BREAK case 15: YY_RULE_SETUP -#line 194 "Scanner.l" +#line 204 "Scanner.l" return TOK_ADD; YY_BREAK case 16: YY_RULE_SETUP -#line 195 "Scanner.l" +#line 205 "Scanner.l" return TOK_SUB; YY_BREAK case 17: YY_RULE_SETUP -#line 196 "Scanner.l" +#line 206 "Scanner.l" return TOK_MUL; YY_BREAK case 18: YY_RULE_SETUP -#line 197 "Scanner.l" +#line 207 "Scanner.l" return TOK_DIV; YY_BREAK case 19: YY_RULE_SETUP -#line 198 "Scanner.l" +#line 208 "Scanner.l" return TOK_MOD; YY_BREAK case 20: YY_RULE_SETUP -#line 199 "Scanner.l" +#line 209 "Scanner.l" return TOK_LPAREN; YY_BREAK case 21: YY_RULE_SETUP -#line 200 "Scanner.l" +#line 210 "Scanner.l" return TOK_RPAREN; YY_BREAK case 22: YY_RULE_SETUP -#line 201 "Scanner.l" +#line 211 "Scanner.l" return TOK_LBRACKET; YY_BREAK case 23: YY_RULE_SETUP -#line 202 "Scanner.l" +#line 212 "Scanner.l" return TOK_RBRACKET; YY_BREAK case 24: YY_RULE_SETUP -#line 203 "Scanner.l" +#line 213 "Scanner.l" return TOK_SCOPE_DELIMITER; YY_BREAK case 25: YY_RULE_SETUP -#line 205 "Scanner.l" +#line 215 "Scanner.l" { return freeze_script_text[0]; } YY_BREAK case 26: YY_RULE_SETUP -#line 209 "Scanner.l" +#line 219 "Scanner.l" ECHO; YY_BREAK -#line 1083 "lex.yy.c" +#line 1079 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1835,8 +1831,8 @@ YY_BUFFER_STATE freeze_script__scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to freeze_script_lex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -2075,7 +2071,7 @@ void freeze_script_free (void * ptr ) #define YYTABLES_NAME "yytables" -#line 209 "Scanner.l" +#line 219 "Scanner.l" diff --git a/cpp/src/FreezeScript/Scanner.l b/cpp/src/FreezeScript/Scanner.l index 81974e656b5..badad602828 100644 --- a/cpp/src/FreezeScript/Scanner.l +++ b/cpp/src/FreezeScript/Scanner.l @@ -39,6 +39,16 @@ # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef freeze_script_wrap +# undef freeze_script_wrap +# define freeze_script_wrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + using namespace std; using namespace FreezeScript; diff --git a/cpp/src/Glacier2Lib/Makefile b/cpp/src/Glacier2Lib/Makefile index cc3ab417519..7f5353822e3 100644 --- a/cpp/src/Glacier2Lib/Makefile +++ b/cpp/src/Glacier2Lib/Makefile @@ -37,7 +37,7 @@ SDIR = $(slicedir)/Glacier2 include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) $(OPENSSL_FLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) $(OPENSSL_FLAGS) -DGLACIER2_API_EXPORTS SLICE2CPPFLAGS := --include-dir Glacier2 --dll-export GLACIER2_API $(SLICE2CPPFLAGS) LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil diff --git a/cpp/src/Ice/ImplicitContextI.cpp b/cpp/src/Ice/ImplicitContextI.cpp index 9da2940ff6c..86118533e67 100644 --- a/cpp/src/Ice/ImplicitContextI.cpp +++ b/cpp/src/Ice/ImplicitContextI.cpp @@ -55,9 +55,6 @@ public: virtual void write(const Context&, ::IceInternal::BasicStream*) const; virtual void combine(const Context&, Context&) const; - - static void threadDestructor(void*); - struct Slot { @@ -104,6 +101,9 @@ private: #endif } +extern "C" void iceImplicitContextThreadDestructor(void*); + + /*static*/ ImplicitContextI* ImplicitContextI::create(const std::string& kind) @@ -141,8 +141,7 @@ ImplicitContextI::cleanupThread() { if(PerThreadImplicitContext::_nextId > 0) { - PerThreadImplicitContext::threadDestructor( - TlsGetValue(PerThreadImplicitContext::_key)); + iceImplicitContextThreadDestructor(TlsGetValue(PerThreadImplicitContext::_key)); } } #endif @@ -310,7 +309,7 @@ PerThreadImplicitContext::PerThreadImplicitContext() throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } # else - int err = pthread_key_create(&_key, &threadDestructor); + int err = pthread_key_create(&_key, &iceImplicitContextThreadDestructor); if(err != 0) { throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, err); @@ -351,26 +350,6 @@ PerThreadImplicitContext::~PerThreadImplicitContext() } } -/*static*/ void -PerThreadImplicitContext::threadDestructor(void* v) -{ - SlotVector* sv = static_cast(v); - if(sv != 0) - { - // - // Cleanup each slot - // - for(SlotVector::iterator p = sv->begin(); p != sv->end(); ++p) - { - delete p->context; - } - // - // Then the vector - // - delete sv; - } -} - Context* PerThreadImplicitContext::getThreadContext(bool allocate) const { @@ -635,4 +614,24 @@ PerThreadImplicitContext::combine(const Context& proxyCtx, Context& ctx) const ctx.insert(threadCtx->begin(), threadCtx->end()); } } + +extern "C" void iceImplicitContextThreadDestructor(void* v) +{ + PerThreadImplicitContext::SlotVector* sv = static_cast(v); + if(sv != 0) + { + // + // Cleanup each slot + // + for(PerThreadImplicitContext::SlotVector::iterator p = sv->begin(); p != sv->end(); ++p) + { + delete p->context; + } + // + // Then the vector + // + delete sv; + } +} + #endif diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index 9b1094ee0dc..b49a8b6f132 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -64,10 +64,6 @@ using namespace Windows::Networking; using namespace Windows::Networking::Sockets; #endif -#if defined(__sun) && !defined(__GNUC__) -# define INADDR_NONE (in_addr_t)0xffffffff -#endif - namespace { @@ -1129,11 +1125,11 @@ IceInternal::inetAddrToString(const Address& ss) int size = 0; if(ss.ss_family == AF_INET) { - size = sizeof(sockaddr_in); + size = static_cast(sizeof(sockaddr_in)); } else if(ss.ss_family == AF_INET6) { - size = sizeof(sockaddr_in6); + size = static_cast(sizeof(sockaddr_in6)); } else { @@ -1142,7 +1138,7 @@ IceInternal::inetAddrToString(const Address& ss) char namebuf[1024]; namebuf[0] = '\0'; - getnameinfo(reinterpret_cast(&ss), size, namebuf, sizeof(namebuf), 0, 0, NI_NUMERICHOST); + getnameinfo(reinterpret_cast(&ss), size, namebuf, static_cast(sizeof(namebuf)), 0, 0, NI_NUMERICHOST); return string(namebuf); #else if(ss.host == nullptr) @@ -1627,11 +1623,11 @@ IceInternal::doBind(SOCKET fd, const Address& addr) int size; if(addr.ss_family == AF_INET) { - size = sizeof(sockaddr_in); + size = static_cast(sizeof(sockaddr_in)); } else if(addr.ss_family == AF_INET6) { - size = sizeof(sockaddr_in6); + size = static_cast(sizeof(sockaddr_in6)); } else { @@ -1843,11 +1839,11 @@ repeatConnect: int size; if(addr.ss_family == AF_INET) { - size = sizeof(sockaddr_in); + size = static_cast(sizeof(sockaddr_in)); } else if(addr.ss_family == AF_INET6) { - size = sizeof(sockaddr_in6); + size = static_cast(sizeof(sockaddr_in6)); } else { diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index 9ea1b473d09..6ad286f4e01 100644 --- a/cpp/src/Ice/PropertyNames.cpp +++ b/cpp/src/Ice/PropertyNames.cpp @@ -8,7 +8,7 @@ // ********************************************************************** // -// Generated by makeprops.py from file ../config/PropertyNames.xml, Mon Apr 30 16:36:44 2012 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Thu Sep 6 15:42:54 2012 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index bc0c7f946f6..3de0b8faecd 100644 --- a/cpp/src/Ice/PropertyNames.h +++ b/cpp/src/Ice/PropertyNames.h @@ -8,7 +8,7 @@ // ********************************************************************** // -// Generated by makeprops.py from file ../config/PropertyNames.xml, Mon Apr 30 16:36:44 2012 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Thu Sep 6 15:42:54 2012 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -47,9 +47,9 @@ struct PropertyArray const Property* properties; const int length; - PropertyArray(const Property* p, int len) : + PropertyArray(const Property* p, size_t len) : properties(p), - length(len) + length(static_cast(len)) { } }; diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp index 1bcaed5b087..d6921c5a54d 100644 --- a/cpp/src/Ice/Selector.cpp +++ b/cpp/src/Ice/Selector.cpp @@ -553,7 +553,9 @@ Selector::~Selector() void Selector::destroy() { +#if !defined(ICE_USE_SELECT) && !defined(ICE_USE_POLL) assert(_events.empty()); +#endif } void diff --git a/cpp/src/Ice/StreamI.h b/cpp/src/Ice/StreamI.h index 7c2e8546d9a..8d9bba4e977 100644 --- a/cpp/src/Ice/StreamI.h +++ b/cpp/src/Ice/StreamI.h @@ -88,6 +88,10 @@ public: virtual void read(std::pair&, ::IceUtil::ScopedArray&); virtual void read(std::pair&, ::IceUtil::ScopedArray&); +#ifdef __SUNPRO_CC + using InputStream::read; +#endif + virtual bool readOptional(Int, OptionalType); virtual void closure(void*); @@ -139,6 +143,10 @@ public: virtual void write(const Float*, const Float*); virtual void write(const Double*, const Double*); +#ifdef __SUNPRO_CC + using OutputStream::write; +#endif + virtual void writeOptional(Int, OptionalType); virtual void startObject(const SlicedDataPtr&); diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp index b1aa39ddd96..b0f26d70b8f 100644 --- a/cpp/src/Ice/UdpTransceiver.cpp +++ b/cpp/src/Ice/UdpTransceiver.cpp @@ -177,11 +177,11 @@ repeat: socklen_t len = static_cast(sizeof(_peerAddr)); if(_peerAddr.ss_family == AF_INET) { - len = sizeof(sockaddr_in); + len = static_cast(sizeof(sockaddr_in)); } else if(_peerAddr.ss_family == AF_INET6) { - len = sizeof(sockaddr_in6); + len = static_cast(sizeof(sockaddr_in6)); } else { diff --git a/cpp/src/IceGrid/AdminI.cpp b/cpp/src/IceGrid/AdminI.cpp index 7453a93902b..f65f0a26cce 100644 --- a/cpp/src/IceGrid/AdminI.cpp +++ b/cpp/src/IceGrid/AdminI.cpp @@ -810,12 +810,14 @@ AdminI::getNodeProcessorSocketCount(const string& name, const Current&) const catch(const Ice::ObjectNotExistException&) { throw NodeNotExistException(name); + return 0; } catch(const Ice::LocalException& ex) { ostringstream os; os << ex; throw NodeUnreachableException(name, os.str()); + return 0; } } diff --git a/cpp/src/IceGrid/AdminSessionI.cpp b/cpp/src/IceGrid/AdminSessionI.cpp index 501af30ab80..25aeaffe85a 100644 --- a/cpp/src/IceGrid/AdminSessionI.cpp +++ b/cpp/src/IceGrid/AdminSessionI.cpp @@ -238,6 +238,7 @@ AdminSessionI::openServerLog(const string& id, const string& path, int nLines, c catch(const SynchronizationException&) { throw DeploymentException("server is being updated"); + return 0; } } @@ -251,6 +252,7 @@ AdminSessionI::openServerStdOut(const string& id, int nLines, const Ice::Current catch(const SynchronizationException&) { throw DeploymentException("server is being updated"); + return 0; } } @@ -264,6 +266,7 @@ AdminSessionI::openServerStdErr(const string& id, int nLines, const Ice::Current catch(const SynchronizationException&) { throw DeploymentException("server is being updated"); + return 0; } } diff --git a/cpp/src/IceGrid/DescriptorBuilder.h b/cpp/src/IceGrid/DescriptorBuilder.h index 8472e4bf4fd..5a0358cb936 100644 --- a/cpp/src/IceGrid/DescriptorBuilder.h +++ b/cpp/src/IceGrid/DescriptorBuilder.h @@ -15,6 +15,13 @@ #include #include +#ifdef __SUNPRO_CC +// +// We hide some init functions on purpose in classes below +// +# pragma error_messages(off,hidef) +#endif + namespace IceGrid { @@ -310,6 +317,10 @@ private: ServiceDescriptorPtr _descriptor; }; -}; +} + +#ifdef __SUNPRO_CC +# pragma error_messages(default,hidef) +#endif #endif diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp index 67467f280f9..8c339ae8166 100644 --- a/cpp/src/IceGrid/DescriptorHelper.cpp +++ b/cpp/src/IceGrid/DescriptorHelper.cpp @@ -18,6 +18,13 @@ using namespace IceUtil; using namespace IceUtilInternal; using namespace IceGrid; +#ifdef __SUNPRO_CC +// +// Disable warning about unassigned function objects +// +# pragma error_messages(off,unassigned) +#endif + namespace IceGrid { diff --git a/cpp/src/IceGrid/DescriptorHelper.h b/cpp/src/IceGrid/DescriptorHelper.h index dbc72e919c9..729731f3698 100644 --- a/cpp/src/IceGrid/DescriptorHelper.h +++ b/cpp/src/IceGrid/DescriptorHelper.h @@ -225,7 +225,7 @@ public: protected: -#if defined(__sun) +#ifdef __SUNPRO_CC using ServerHelper::instantiateImpl; #endif diff --git a/cpp/src/IceGrid/Scanner.cpp b/cpp/src/IceGrid/Scanner.cpp index 7a5103303c3..9716be00a08 100644 --- a/cpp/src/IceGrid/Scanner.cpp +++ b/cpp/src/IceGrid/Scanner.cpp @@ -54,6 +54,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,8 +85,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -142,15 +141,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -507,6 +498,16 @@ using namespace IceGrid; # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef yywrap +# undef yywrap +# define yywrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) namespace IceGrid @@ -522,7 +523,7 @@ std::string parseSingleQuotedString(); } #define YY_USER_INIT initScanner(); -#line 525 "lex.yy.c" +#line 526 "lex.yy.c" #define INITIAL 0 @@ -603,12 +604,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -616,7 +612,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 do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -627,7 +623,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -709,10 +705,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 65 "Scanner.l" +#line 75 "Scanner.l" -#line 715 "lex.yy.c" +#line 711 "lex.yy.c" if ( !(yy_init) ) { @@ -797,7 +793,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 67 "Scanner.l" +#line 77 "Scanner.l" { // C++-style comment int c; @@ -810,7 +806,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 77 "Scanner.l" +#line 87 "Scanner.l" { // C-style comment while(true) @@ -839,7 +835,7 @@ YY_RULE_SETUP case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 102 "Scanner.l" +#line 112 "Scanner.l" { size_t len = strlen(yytext); for(size_t i = 0; i < len; ++i) @@ -854,14 +850,14 @@ YY_RULE_SETUP case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 113 "Scanner.l" +#line 123 "Scanner.l" { return ';'; } YY_BREAK case 5: YY_RULE_SETUP -#line 117 "Scanner.l" +#line 127 "Scanner.l" { // "..."-type strings string s = parseDoubleQuotedString(); @@ -872,7 +868,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 125 "Scanner.l" +#line 135 "Scanner.l" { // '...'-type strings string s; @@ -900,7 +896,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 150 "Scanner.l" +#line 160 "Scanner.l" { // Simple strings string s; @@ -939,10 +935,10 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 186 "Scanner.l" +#line 196 "Scanner.l" ECHO; YY_BREAK -#line 945 "lex.yy.c" +#line 941 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1696,8 +1692,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -1936,7 +1932,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 186 "Scanner.l" +#line 196 "Scanner.l" diff --git a/cpp/src/IceGrid/Scanner.l b/cpp/src/IceGrid/Scanner.l index 200b4f7598d..924d074c9fc 100644 --- a/cpp/src/IceGrid/Scanner.l +++ b/cpp/src/IceGrid/Scanner.l @@ -38,6 +38,16 @@ using namespace IceGrid; # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef yywrap +# undef yywrap +# define yywrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) namespace IceGrid diff --git a/cpp/src/IcePatch2Lib/Util.cpp b/cpp/src/IcePatch2Lib/Util.cpp index 7540d21864f..21ee03196ba 100755 --- a/cpp/src/IcePatch2Lib/Util.cpp +++ b/cpp/src/IcePatch2Lib/Util.cpp @@ -37,78 +37,6 @@ const char* IcePatch2::checksumFile = "IcePatch2.sum"; const char* IcePatch2::logFile = "IcePatch2.log"; -// -// Solaris 9 and before doesn't have scandir() or alphasort(). -// -#ifdef __sun - -extern "C" int -ice_scandir(const char* dir, struct dirent*** namelist, - int (*select)(const struct dirent*), - int (*compar)(const void*, const void*)) -{ - DIR* d; - struct dirent* entry; - register int i = 0; - size_t entrysize; - - if((d = opendir(dir)) == 0) - { - return -1; - } - - *namelist = 0; - while((entry = readdir(d)) != 0) - { - if(select == 0 || (select != 0 && (*select)(entry))) - { - *namelist = (struct dirent**)realloc((void*)(*namelist), (size_t)((i + 1) * sizeof(struct dirent*))); - if(*namelist == 0) - { - closedir(d); - return -1; - } - - entrysize = sizeof(struct dirent) - sizeof(entry->d_name) + strlen(entry->d_name) + 1; - (*namelist)[i] = (struct dirent*)malloc(entrysize); - if((*namelist)[i] == 0) - { - closedir(d); - return -1; - } - memcpy((*namelist)[i], entry, entrysize); - ++i; - } - } - - if(closedir(d)) - { - return -1; - } - - if(i == 0) - { - return -1; - } - - if(compar != 0) - { - qsort((void *)(*namelist), (size_t)i, sizeof(struct dirent *), compar); - } - - return i; -} - -extern "C" int -ice_alphasort(const void* v1, const void* v2) -{ - const struct dirent **a = (const struct dirent **)v1; - const struct dirent **b = (const struct dirent **)v2; - return(strcmp((*a)->d_name, (*b)->d_name)); -} - -#endif - using namespace std; using namespace Ice; using namespace IcePatch2; @@ -530,11 +458,8 @@ IcePatch2::readDirectory(const string& pa) #else struct dirent **namelist; -#ifdef __sun - int n = ice_scandir(path.c_str(), &namelist, 0, ice_alphasort); -#else int n = scandir(path.c_str(), &namelist, 0, alphasort); -#endif + if(n < 0) { throw "cannot read directory `" + path + "':\n" + IceUtilInternal::lastErrorToString(); diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp index da9e7e2c4b9..7479263eb33 100644 --- a/cpp/src/IceSSL/Certificate.cpp +++ b/cpp/src/IceSSL/Certificate.cpp @@ -18,6 +18,22 @@ #include #include +#ifdef __SUNPRO_CC + +// +// The call to sk_GENERAL_NAME_pop_free fails to compile if we don't +// remove the extern "C" vs non extern "C" check with the macro below: +// + +extern "C" typedef void (*FreeFunc)(void*); + +#undef CHECKED_SK_FREE_FUNC +#define CHECKED_SK_FREE_FUNC(type, p) \ + (FreeFunc) (p) + +#endif + + using namespace std; using namespace Ice; using namespace IceSSL; diff --git a/cpp/src/IceStorm/Observers.h b/cpp/src/IceStorm/Observers.h index 23e326938f8..b5bc223c77c 100644 --- a/cpp/src/IceStorm/Observers.h +++ b/cpp/src/IceStorm/Observers.h @@ -15,6 +15,11 @@ #include #include +#ifdef __SUNPRO_CC +# pragma error_messages(off,hidef) +#endif + + namespace IceStorm { class Instance; @@ -66,4 +71,8 @@ typedef IceUtil::Handle ObserversPtr; } +#ifdef __SUNPRO_CC +# pragma error_messages(default,hidef) +#endif + #endif // OBSERVERS_H diff --git a/cpp/src/IceStorm/Scanner.cpp b/cpp/src/IceStorm/Scanner.cpp index 7c38d13adde..e6e81e808f6 100644 --- a/cpp/src/IceStorm/Scanner.cpp +++ b/cpp/src/IceStorm/Scanner.cpp @@ -54,6 +54,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,8 +85,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -142,15 +141,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -507,6 +498,16 @@ using namespace IceStorm; # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef yywrap +# undef yywrap +# define yywrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) namespace IceStorm @@ -520,7 +521,7 @@ void initScanner(); } #define YY_USER_INIT initScanner(); -#line 523 "lex.yy.c" +#line 524 "lex.yy.c" #define INITIAL 0 @@ -601,12 +602,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -614,7 +610,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 do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -625,7 +621,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -707,10 +703,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 63 "Scanner.l" +#line 73 "Scanner.l" -#line 713 "lex.yy.c" +#line 709 "lex.yy.c" if ( !(yy_init) ) { @@ -795,7 +791,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 65 "Scanner.l" +#line 75 "Scanner.l" { // C++-style comment int c; @@ -808,7 +804,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 75 "Scanner.l" +#line 85 "Scanner.l" { // C-style comment while(true) @@ -837,7 +833,7 @@ YY_RULE_SETUP case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 100 "Scanner.l" +#line 110 "Scanner.l" { size_t len = strlen(yytext); for(size_t i = 0; i < len; ++i) @@ -852,14 +848,14 @@ YY_RULE_SETUP case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 111 "Scanner.l" +#line 121 "Scanner.l" { return ';'; } YY_BREAK case 5: YY_RULE_SETUP -#line 115 "Scanner.l" +#line 125 "Scanner.l" { // "..."-type strings string s; @@ -936,7 +932,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 189 "Scanner.l" +#line 199 "Scanner.l" { // '...'-type strings string s; @@ -964,7 +960,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 214 "Scanner.l" +#line 224 "Scanner.l" { // Simple strings string s; @@ -994,10 +990,10 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 241 "Scanner.l" +#line 251 "Scanner.l" ECHO; YY_BREAK -#line 1000 "lex.yy.c" +#line 996 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1751,8 +1747,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -1991,7 +1987,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 241 "Scanner.l" +#line 251 "Scanner.l" diff --git a/cpp/src/IceStorm/Scanner.l b/cpp/src/IceStorm/Scanner.l index 4051c044020..30aeb5b44b4 100644 --- a/cpp/src/IceStorm/Scanner.l +++ b/cpp/src/IceStorm/Scanner.l @@ -38,6 +38,16 @@ using namespace IceStorm; # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef yywrap +# undef yywrap +# define yywrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) namespace IceStorm diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp index d561cf70459..bdb53910031 100644 --- a/cpp/src/IceXML/Parser.cpp +++ b/cpp/src/IceXML/Parser.cpp @@ -323,8 +323,8 @@ startElementHandler(void* data, const XML_Char* name, const XML_Char** attr) attributes[attr[i]] = attr[i + 1]; } - int line = XML_GetCurrentLineNumber(cb->parser); - int column = XML_GetCurrentColumnNumber(cb->parser); + int line = static_cast(XML_GetCurrentLineNumber(cb->parser)); + int column = static_cast(XML_GetCurrentColumnNumber(cb->parser)); cb->handler->startElement(name, attributes, line, column); } @@ -332,8 +332,8 @@ static void endElementHandler(void* data, const XML_Char* name) { CallbackData* cb = static_cast(data); - int line = XML_GetCurrentLineNumber(cb->parser); - int column = XML_GetCurrentColumnNumber(cb->parser); + int line = static_cast(XML_GetCurrentLineNumber(cb->parser)); + int column = static_cast(XML_GetCurrentColumnNumber(cb->parser)); cb->handler->endElement(name, line, column); } @@ -343,8 +343,8 @@ characterDataHandler(void* data, const XML_Char* s, int len) CallbackData* cb = static_cast(data); string str(s, len); - int line = XML_GetCurrentLineNumber(cb->parser); - int column = XML_GetCurrentColumnNumber(cb->parser); + int line = static_cast(XML_GetCurrentLineNumber(cb->parser)); + int column = static_cast(XML_GetCurrentColumnNumber(cb->parser)); cb->handler->characters(str, line, column); } @@ -406,8 +406,9 @@ IceXML::Parser::parse(istream& in, Handler& handler) } if(XML_Parse(parser, buff, static_cast(in.gcount()), isFinal) != 1) { - handler.error(XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser), - XML_GetCurrentColumnNumber(parser)); + handler.error(XML_ErrorString(XML_GetErrorCode(parser)), + static_cast(XML_GetCurrentLineNumber(parser)), + static_cast(XML_GetCurrentColumnNumber(parser))); return; } } diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index e7ecd451617..1ac81d36880 100755 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -2407,23 +2407,11 @@ Slice::Container::validateConstant(const string& name, const TypePtr& type, cons if(constant) { -#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530) - // Strange Sun C++ 5.3 bug. - const IceUtil::HandleBase& hb = constant->type(); - lt = BuiltinPtr::dynamicCast(hb); -#else lt = BuiltinPtr::dynamicCast(constant->type()); -#endif } else { -#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530) - // Strange Sun C++ 5.3 bug. - const IceUtil::HandleBase& hb = valueType; - lt = BuiltinPtr::dynamicCast(hb); -#else lt = BuiltinPtr::dynamicCast(valueType); -#endif } if(lt) diff --git a/cpp/src/Slice/Scanner.cpp b/cpp/src/Slice/Scanner.cpp index 54541891c2e..87667e38132 100644 --- a/cpp/src/Slice/Scanner.cpp +++ b/cpp/src/Slice/Scanner.cpp @@ -74,6 +74,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -104,8 +105,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -162,15 +161,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -591,6 +582,16 @@ char *slice_text; # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef slice_wrap +# undef slice_wrap +# define slice_wrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + using namespace std; using namespace Slice; @@ -612,7 +613,7 @@ int checkKeyword(string&); -#line 615 "lex.yy.c" +#line 616 "lex.yy.c" #define INITIAL 0 #define BOMSCAN 1 @@ -695,12 +696,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -708,7 +704,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 do { if (fwrite( slice_text, slice_leng, 1, slice_out )) {} } while (0) +#define ECHO fwrite( slice_text, slice_leng, 1, slice_out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -719,7 +715,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( slice_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -804,10 +800,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 75 "Scanner.l" +#line 85 "Scanner.l" -#line 810 "lex.yy.c" +#line 806 "lex.yy.c" if ( !(yy_init) ) { @@ -892,7 +888,7 @@ case 1: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up slice_text again */ YY_RULE_SETUP -#line 77 "Scanner.l" +#line 87 "Scanner.l" { if(unit->scanPosition(slice_text)) { @@ -906,7 +902,7 @@ case 2: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up slice_text again */ YY_RULE_SETUP -#line 84 "Scanner.l" +#line 94 "Scanner.l" { if(unit->scanPosition(slice_text)) { @@ -919,7 +915,7 @@ case 3: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up slice_text again */ YY_RULE_SETUP -#line 91 "Scanner.l" +#line 101 "Scanner.l" { if(unit->scanPosition(slice_text)) { @@ -933,7 +929,7 @@ case 4: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up slice_text again */ YY_RULE_SETUP -#line 98 "Scanner.l" +#line 108 "Scanner.l" { if(unit->scanPosition(slice_text)) { @@ -943,7 +939,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 105 "Scanner.l" +#line 115 "Scanner.l" { // C++-style comment BEGIN(MAINSCAN); @@ -961,7 +957,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 120 "Scanner.l" +#line 130 "Scanner.l" { // C-style comment BEGIN(MAINSCAN); @@ -1005,7 +1001,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 161 "Scanner.l" +#line 171 "Scanner.l" { BEGIN(MAINSCAN); return ICE_SCOPE_DELIMITER; @@ -1013,7 +1009,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 166 "Scanner.l" +#line 176 "Scanner.l" { BEGIN(MAINSCAN); return ICE_METADATA_OPEN; @@ -1021,7 +1017,7 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 171 "Scanner.l" +#line 181 "Scanner.l" { BEGIN(MAINSCAN); return ICE_METADATA_CLOSE; @@ -1029,7 +1025,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 176 "Scanner.l" +#line 186 "Scanner.l" { BEGIN(MAINSCAN); return ICE_GLOBAL_METADATA_OPEN; @@ -1037,7 +1033,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 181 "Scanner.l" +#line 191 "Scanner.l" { BEGIN(MAINSCAN); return ICE_GLOBAL_METADATA_CLOSE; @@ -1046,7 +1042,7 @@ YY_RULE_SETUP case 12: /* rule 12 can match eol */ YY_RULE_SETUP -#line 186 "Scanner.l" +#line 196 "Scanner.l" { BEGIN(MAINSCAN); StringTokPtr ident = new StringTok; @@ -1074,7 +1070,7 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 211 "Scanner.l" +#line 221 "Scanner.l" { BEGIN(MAINSCAN); StringTokPtr ident = new StringTok; @@ -1085,7 +1081,7 @@ YY_RULE_SETUP YY_BREAK case 14: YY_RULE_SETUP -#line 219 "Scanner.l" +#line 229 "Scanner.l" { BEGIN(MAINSCAN); StringTokPtr str = new StringTok; @@ -1249,7 +1245,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 380 "Scanner.l" +#line 390 "Scanner.l" { BEGIN(MAINSCAN); IntegerTokPtr itp = new IntegerTok; @@ -1268,7 +1264,7 @@ YY_RULE_SETUP YY_BREAK case 16: YY_RULE_SETUP -#line 396 "Scanner.l" +#line 406 "Scanner.l" { BEGIN(MAINSCAN); errno = 0; @@ -1302,7 +1298,7 @@ YY_RULE_SETUP case 17: /* rule 17 can match eol */ YY_RULE_SETUP -#line 426 "Scanner.l" +#line 436 "Scanner.l" { // Ignore white-space @@ -1318,7 +1314,7 @@ YY_RULE_SETUP YY_BREAK case 18: YY_RULE_SETUP -#line 439 "Scanner.l" +#line 449 "Scanner.l" { // Ignore UTF-8 BOM, rule only active when parsing start of file. @@ -1327,7 +1323,7 @@ YY_RULE_SETUP YY_BREAK case 19: YY_RULE_SETUP -#line 445 "Scanner.l" +#line 455 "Scanner.l" { BEGIN(MAINSCAN); if(slice_text[0] < 32 || slice_text[0] > 126) @@ -1346,10 +1342,10 @@ YY_RULE_SETUP YY_BREAK case 20: YY_RULE_SETUP -#line 461 "Scanner.l" +#line 471 "Scanner.l" ECHO; YY_BREAK -#line 1352 "lex.yy.c" +#line 1348 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(BOMSCAN): case YY_STATE_EOF(MAINSCAN): @@ -2109,8 +2105,8 @@ YY_BUFFER_STATE slice__scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to slice_lex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -2349,7 +2345,7 @@ void slice_free (void * ptr ) #define YYTABLES_NAME "yytables" -#line 461 "Scanner.l" +#line 471 "Scanner.l" diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 2363abeb847..1d981e3e567 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -37,6 +37,16 @@ # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef slice_wrap +# undef slice_wrap +# define slice_wrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + using namespace std; using namespace Slice; diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp index c8d98fc400f..8e0fe4c8bdc 100644 --- a/cpp/src/Slice/Util.cpp +++ b/cpp/src/Slice/Util.cpp @@ -115,7 +115,7 @@ Slice::fullPath(const string& path) } char buf[PATH_MAX + 1]; - int len = readlink(subpath.c_str(), buf, sizeof(buf)); + int len = static_cast(readlink(subpath.c_str(), buf, sizeof(buf))); if(len > 0) { buf[len] = '\0'; diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp index a08642d2650..ff267b46e99 100755 --- a/cpp/src/slice2freezej/Main.cpp +++ b/cpp/src/slice2freezej/Main.cpp @@ -100,7 +100,13 @@ public: void generate(UnitPtr&, const Index&); +#ifdef __SUNPRO_CC +protected: + using JavaGenerator::typeToObjectString; +#endif + private: + string typeToObjectString(const TypePtr&); string varToObject(const TypePtr&, const string&); string objectToVar(const TypePtr&, const string&); diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 1a9b678b6aa..1b049475ffd 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -2442,22 +2442,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) const bool hasAMD = cl->hasMetaData("amd") || (*r)->hasMetaData("amd"); const bool optionalMapping = useOptionalMapping(*r); -#if defined(__SUNPRO_CC) && (__SUNPRO_CC==0x550) - // - // Work around for Sun CC 5.5 bug #4853566 - // - string opName; - if(hasAMD) - { - opName = (*r)->name() + "_async"; - } - else - { - opName = fixKwd((*r)->name()); - } -#else string opName = hasAMD ? (*r)->name() + "_async" : fixKwd((*r)->name()); -#endif TypePtr ret = (*r)->returnType(); string retS = typeToString(ret, TypeModeReturn, package, (*r)->getMetaData(), true, -- cgit v1.2.3