diff options
author | ocielliottc <elliottc@objectcomputing.com> | 2022-12-06 13:45:59 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-06 13:45:59 -0600 |
commit | a824af374a4ed77a7a4f603675680e395b87cdc9 (patch) | |
tree | 81c039863887f865bf13a97d315b9fd72302d170 | |
parent | 2f89988cf4227972a7e67d88d56ac5f0f81d1d25 (diff) | |
parent | ef617e3f28567a8bbb356829fa344f90bb7aea9a (diff) | |
download | ATCD-a824af374a4ed77a7a4f603675680e395b87cdc9.tar.gz |
Merge pull request #1986 from DOCGroup/elliottc/715-fix-warnings
[ace6tao2] Fix build warnings (as shown by builds for OpenDDS)
-rw-r--r-- | ACE/ace/Acceptor.cpp | 13 | ||||
-rw-r--r-- | ACE/ace/OS_NS_signal.inl | 14 | ||||
-rw-r--r-- | ACE/ace/SString.h | 3 | ||||
-rw-r--r-- | ACE/ace/SString.inl | 7 | ||||
-rw-r--r-- | ACE/ace/UNIX_Addr.h | 3 | ||||
-rw-r--r-- | ACE/ace/UNIX_Addr.inl | 7 |
6 files changed, 39 insertions, 8 deletions
diff --git a/ACE/ace/Acceptor.cpp b/ACE/ace/Acceptor.cpp index b9246fc5e54..624e69cd82f 100644 --- a/ACE/ace/Acceptor.cpp +++ b/ACE/ace/Acceptor.cpp @@ -163,7 +163,6 @@ ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info (ACE_TCHAR **strp, size_t length) const { ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info"); - ACE_TCHAR buf[BUFSIZ]; ACE_TCHAR addr_str[BUFSIZ]; typename PEER_ACCEPTOR::PEER_ADDR addr; @@ -172,7 +171,17 @@ ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info (ACE_TCHAR **strp, else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) return -1; - ACE_OS::snprintf (buf, BUFSIZ, + // + // gcc10 complains that it is possible that buf could be truncated by up to + // 35 bytes in this call to snprintf. Technically, this is possible + // (however unlikely that may be). Since addr_str is defined to be of size + // BUFSIZ, gcc assumes that the string could actually be BUFSIZ in length. + // That makes the possible total length of the combined string (given the + // size of the literal string constants) 3 + 12 + BUFSIZE + 19 + 1. + // + const size_t additional = 35; + ACE_TCHAR buf[BUFSIZ + additional]; + ACE_OS::snprintf (buf, sizeof buf, ACE_TEXT ("%s\t %s %s"), ACE_TEXT ("ACE_Acceptor"), addr_str, diff --git a/ACE/ace/OS_NS_signal.inl b/ACE/ace/OS_NS_signal.inl index e125f430c1c..2fbf938b7b0 100644 --- a/ACE/ace/OS_NS_signal.inl +++ b/ACE/ace/OS_NS_signal.inl @@ -199,19 +199,21 @@ signal (int signum, ACE_SignalHandler func) if (signum == 0) return 0; else + { #if (defined ACE_WIN32 && !defined ACE_HAS_WINCE) || \ (!defined ACE_LACKS_UNIX_SIGNALS && !defined ACE_LACKS_SIGNAL) # if !defined (ACE_HAS_TANDEM_SIGNALS) && !defined (ACE_HAS_LYNXOS4_SIGNALS) - return ::signal (signum, func); + return ::signal (signum, func); # else - return (ACE_SignalHandler) ::signal (signum, (void (*)(int)) func); + return (ACE_SignalHandler) ::signal (signum, (void (*)(int)) func); # endif /* !ACE_HAS_TANDEM_SIGNALS && !ACE_HAS_LYNXOS4_SIGNALS */ #else - // @@ WINCE: Don't know how to implement signal on WinCE (yet.) - ACE_UNUSED_ARG (signum); - ACE_UNUSED_ARG (func); - ACE_NOTSUP_RETURN (0); // Should return SIG_ERR but it is not defined on WinCE. + // @@ WINCE: Don't know how to implement signal on WinCE (yet.) + ACE_UNUSED_ARG (signum); + ACE_UNUSED_ARG (func); + ACE_NOTSUP_RETURN (0); // Should return SIG_ERR but it is not defined on WinCE. #endif /* defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) || !defined (ACE_LACKS_UNIX_SIGNALS) */ + } } ACE_INLINE int diff --git a/ACE/ace/SString.h b/ACE/ace/SString.h index 1f4f6749e83..f421a509868 100644 --- a/ACE/ace/SString.h +++ b/ACE/ace/SString.h @@ -93,6 +93,9 @@ public: /// Constructor that copies @a c into dynamically allocated memory. ACE_NS_WString (ACE_WSTRING_TYPE c, ACE_Allocator *alloc = 0); + /// Assignment operator (does copy memory). + ACE_NS_WString &operator = (const ACE_NS_WString &rhs); + /// Transform into a copy of the ASCII character representation. /// (caller must delete) char *char_rep (void) const; diff --git a/ACE/ace/SString.inl b/ACE/ace/SString.inl index c5685c0905b..11441def011 100644 --- a/ACE/ace/SString.inl +++ b/ACE/ace/SString.inl @@ -49,6 +49,13 @@ ACE_NS_WString::ACE_NS_WString (ACE_WSTRING_TYPE c, ACE_Allocator *alloc) { } +ACE_INLINE ACE_NS_WString & +ACE_NS_WString::operator = (const ACE_NS_WString &rhs) +{ + ACE_WString::operator = (rhs); + return *this; +} + ACE_INLINE ACE_NS_WString operator+ (const ACE_NS_WString &s, const ACE_NS_WString &t) { diff --git a/ACE/ace/UNIX_Addr.h b/ACE/ace/UNIX_Addr.h index d0851feb3ba..7473aab03e9 100644 --- a/ACE/ace/UNIX_Addr.h +++ b/ACE/ace/UNIX_Addr.h @@ -49,6 +49,9 @@ public: /// Creates an ACE_INET_Addr from a sockaddr_un structure. ACE_UNIX_Addr (const sockaddr_un *, int len); + /// Assignment operator + ACE_UNIX_Addr &operator = (const ACE_UNIX_Addr &rhs); + /// Creates an ACE_UNIX_Addr from another ACE_UNIX_Addr. int set (const ACE_UNIX_Addr &sa); diff --git a/ACE/ace/UNIX_Addr.inl b/ACE/ace/UNIX_Addr.inl index f19ef68a52b..fdf9dc5a287 100644 --- a/ACE/ace/UNIX_Addr.inl +++ b/ACE/ace/UNIX_Addr.inl @@ -23,6 +23,13 @@ ACE_UNIX_Addr::set (const wchar_t rendezvous_point[]) } #endif /* ACE_HAS_WCHAR */ +ACE_INLINE ACE_UNIX_Addr & +ACE_UNIX_Addr::operator = (const ACE_UNIX_Addr &rhs) +{ + this->set (rhs); + return *this; +} + // Compare two addresses for equality. ACE_INLINE bool |