summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-12-14 08:04:51 -0600
committerChad Elliott <elliottc@objectcomputing.com>2022-12-14 08:04:51 -0600
commit5e0418d120dbff81325bd20bb575c09e550023a5 (patch)
tree3265384d5cacef2da3639c5965d422dd9152d7f3
parent8038e3e754d1307c2d465f3029909fd4f7b27a1b (diff)
downloadATCD-5e0418d120dbff81325bd20bb575c09e550023a5.tar.gz
Pulled in changes from ACE 7.
-rw-r--r--ACE/ACEXML/parser/parser/Parser.cpp10
-rw-r--r--ACE/ace/OS_NS_string.cpp6
-rw-r--r--ACE/ace/Process.cpp3
-rw-r--r--ACE/ace/Process_Manager.cpp3
-rw-r--r--ACE/ace/config-macros.h11
-rw-r--r--TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp11
6 files changed, 32 insertions, 12 deletions
diff --git a/ACE/ACEXML/parser/parser/Parser.cpp b/ACE/ACEXML/parser/parser/Parser.cpp
index 385ba540c55..687fcd11531 100644
--- a/ACE/ACEXML/parser/parser/Parser.cpp
+++ b/ACE/ACEXML/parser/parser/Parser.cpp
@@ -181,6 +181,7 @@ ACEXML_Parser::parse (ACEXML_InputSource *input)
break;
case 0:
this->fatal_error (ACE_TEXT ("Unexpected end-of-file"));
+ break;
default: // Root element begins
prolog_done = 1;
break;
@@ -541,6 +542,7 @@ ACEXML_Parser::parse_includesect (void)
case 0: // [VC: Proper Conditional Section/PE Nesting]
this->fatal_error (ACE_TEXT ("Invalid Conditional Section/PE ")
ACE_TEXT ("Nesting "));
+ break;
case ']':
if (this->peek() == ']')
{
@@ -551,6 +553,7 @@ ACEXML_Parser::parse_includesect (void)
return 0;
}
}
+ ACE_FALLTHROUGH;
default:
this->fatal_error (ACE_TEXT ("Invalid includeSect"));
}
@@ -596,6 +599,7 @@ ACEXML_Parser::parse_markup_decl (void)
break;
case 0: // [VC: Proper Declaration/PE Nesting]
this->fatal_error (ACE_TEXT ("Unexpected end-of-file"));
+ break;
default:
this->fatal_error (ACE_TEXT ("Invalid markupDecl"));
}
@@ -989,7 +993,7 @@ ACEXML_Parser::parse_content (const ACEXML_Char* startname,
// cdata_length = 0;
// break;
// }
- // Fall thru...
+ ACE_FALLTHROUGH;
default:
++cdata_length;
this->obstack_.grow (ch);
@@ -1368,6 +1372,7 @@ ACEXML_Parser::parse_tokenized_type (void)
// Admittedly, this error message is not precise enough
this->fatal_error(ACE_TEXT ("Expecting keyword `ID', `IDREF', or")
ACE_TEXT ("`IDREFS'"));
+ break;
case 'E': // ENTITY or ENTITIES
if (this->parse_token (ACE_TEXT ("NTIT")) == 0)
{
@@ -1393,6 +1398,7 @@ ACEXML_Parser::parse_tokenized_type (void)
// Admittedly, this error message is not precise enough
this->fatal_error(ACE_TEXT ("Expecting keyword `ENTITY', or")
ACE_TEXT ("`ENTITIES'"));
+ break;
case 'M':
if (this->parse_token (ACE_TEXT ("TOKEN")) == 0)
{
@@ -2854,7 +2860,7 @@ ACEXML_Parser::parse_processing_instruction (void)
}
break;
case 0x0A:
- // Fall thru...
+ ACE_FALLTHROUGH;
default:
if (state == 1)
this->obstack_.grow ('?');
diff --git a/ACE/ace/OS_NS_string.cpp b/ACE/ace/OS_NS_string.cpp
index ff5c4e1e549..03a91a45f2c 100644
--- a/ACE/ace/OS_NS_string.cpp
+++ b/ACE/ace/OS_NS_string.cpp
@@ -83,9 +83,9 @@ ACE_OS::strerror (int errnum)
if (ACE::is_sock_error (errnum))
{
const ACE_TCHAR *errortext = ACE::sock_error (errnum);
- ACE_OS::strncpy (ret_errortext,
- ACE_TEXT_ALWAYS_CHAR (errortext),
- sizeof (ret_errortext));
+ ACE_OS::strsncpy (ret_errortext,
+ ACE_TEXT_ALWAYS_CHAR (errortext),
+ sizeof (ret_errortext));
return ret_errortext;
}
#if defined (ACE_LACKS_STRERROR)
diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp
index a1921102960..10500483e30 100644
--- a/ACE/ace/Process.cpp
+++ b/ACE/ace/Process.cpp
@@ -695,7 +695,8 @@ ACE_Process::wait (const ACE_Time_Value &tv,
// open(), and there's already a SIGCHLD action set, so no
// action is needed here.
ACE_Sig_Action old_action;
- ACE_Sig_Action do_sigchld ((ACE_SignalHandler)sigchld_nop);
+ ACE_Sig_Handler_Ex sigchld_nop_ptr = sigchld_nop;
+ ACE_Sig_Action do_sigchld (reinterpret_cast<ACE_SignalHandler> (reinterpret_cast<void*> (sigchld_nop_ptr)));
do_sigchld.register_action (SIGCHLD, &old_action);
pid_t pid;
diff --git a/ACE/ace/Process_Manager.cpp b/ACE/ace/Process_Manager.cpp
index 4db0f020eed..6a609cb8dc0 100644
--- a/ACE/ace/Process_Manager.cpp
+++ b/ACE/ace/Process_Manager.cpp
@@ -888,7 +888,8 @@ ACE_Process_Manager::wait (pid_t pid,
ACE_Sig_Action old_action;
if (this->reactor () == 0)
{
- ACE_Sig_Action do_sigchld ((ACE_SignalHandler)sigchld_nop);
+ ACE_Sig_Handler_Ex sigchld_nop_ptr = sigchld_nop;
+ ACE_Sig_Action do_sigchld (reinterpret_cast<ACE_SignalHandler> (reinterpret_cast<void*> (sigchld_nop_ptr)));
do_sigchld.register_action (SIGCHLD, &old_action);
}
diff --git a/ACE/ace/config-macros.h b/ACE/ace/config-macros.h
index 5989d2cc6d8..c1aef4c1f08 100644
--- a/ACE/ace/config-macros.h
+++ b/ACE/ace/config-macros.h
@@ -277,6 +277,17 @@
# define ACE_NOTREACHED(a) a
#endif /* ghs || ..... */
+
+// Compiler-specific configs can define ACE_FALLTHROUGH but if not,
+// and it's a C++17 or higher compiler, use the defined mechanism.
+#if !defined ACE_FALLTHROUGH
+# if defined ACE_HAS_CPP17
+# define ACE_FALLTHROUGH [[fallthrough]]
+# else
+# define ACE_FALLTHROUGH
+# endif /* ACE_HAS_CPP17 */
+#endif /* ACE_FALLTHROUGH */
+
// ============================================================================
// ACE_ALLOC_HOOK* macros
//
diff --git a/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp b/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
index 638cce03153..0dc5927131b 100644
--- a/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
@@ -68,15 +68,16 @@ be_visitor_native_ch::visit_native (be_native *node)
// strip the "Seq" ending to get the sample's name
const char * node_name = node->full_name ();
const size_t max_name_length = 2000;
- if (ACE_OS::strlen (node_name) >= max_name_length)
+ const size_t node_name_length = ACE_OS::strlen (node_name);
+ if (node_name_length >= max_name_length ||
+ node_name_length <= 3)
{
return -1;
}
char sample_name[max_name_length];
- ACE_OS::strncpy (sample_name,
- node_name,
- ACE_OS::strlen (node_name) - 3);
- sample_name[ACE_OS::strlen (node_name) - 3] = '\0';
+ // Copy node_name into sample_name and shorten to remove Seq suffix
+ ACE_OS::strcpy (sample_name, node_name);
+ sample_name[node_name_length - 3] = '\0';
*os << be_nl_2
<< "typedef ::TAO::DCPS::ZeroCopyDataSeq< "