Skip to content

Declare TesInitial as static method because it is called from constructor - #2381

Open
andr-sokolov wants to merge 1 commit into
apache:mainfrom
andr-sokolov:w-maybe-uninitialized
Open

andr-sokolov wants to merge 1 commit into
apache:mainfrom
andr-sokolov:w-maybe-uninitialized

Conversation

@andr-sokolov

Copy link
Copy Markdown
Collaborator

Fix the maybe-uninitialized warning from GCC 16

…ctor

Fix the maybe-uninitialized warning from GCC 16

@Vlasdislav Vlasdislav left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Alena0704

Copy link
Copy Markdown
Collaborator

Could we also update these outdated comments? The class uses a transition matrix, and the test rejects eeThree.

diff --git a/src/backend/gporca/libgpopt/include/gpopt/base/CStateMachine.h b/src/backend/gporca/libgpopt/include/gpopt/base/CStateMachine.h
--- a/src/backend/gporca/libgpopt/include/gpopt/base/CStateMachine.h
+++ b/src/backend/gporca/libgpopt/include/gpopt/base/CStateMachine.h
@@ -6,11 +6,9 @@
 //		CStateMachine.h
 //
 //	@doc:
-//		Basic FSM implementation;
-//		This superclass provides the API and handles only the bookkeeping;
-//
-//		Each subclass has to provide a transition function which encodes
-//		the actual state graph and determines validity of transitions;
+//		Basic FSM implementation using a transition matrix supplied to Init().
+//		The class maintains the current state and validates transitions
+//		against that matrix.
 //
 //		Provides debug functionality to draw state diagram and validation
 //		function to detect unreachable states.
@@ -42,7 +40,7 @@
 //		CStateMachine
 //
 //	@doc:
-//		Abstract FSM which accepts events to manage state transitions;
+//		FSM which accepts events to manage state transitions;
 //		Corresponds to a Moore Machine;
 //
 //---------------------------------------------------------------------------
diff --git a/src/backend/gporca/server/src/unittest/gpopt/base/CStateMachineTest.cpp b/src/backend/gporca/server/src/unittest/gpopt/base/CStateMachineTest.cpp
--- a/src/backend/gporca/server/src/unittest/gpopt/base/CStateMachineTest.cpp
+++ b/src/backend/gporca/server/src/unittest/gpopt/base/CStateMachineTest.cpp
@@ -25,9 +25,9 @@
 
 using namespace gpopt;
 
-// State transition diagram for test machine:
-// From every state, event eeX transitions into state esX, e.g. eeOne transitions always to esOne and so on
-// All transitions are considered valid.
+// Transition table for the test machine:
+// From every state, eeOne transitions to esOne and eeTwo to esTwo.
+// Event eeThree is rejected and leaves the current state unchanged.
 //
 static const CStateMachineTest::EEvents
 	rgeevTransitions[CStateMachineTest::esSentinel]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants