[2/2] analyzer: reorder initialization of state m_invalid in sm-fd.cc [PR106184]

Message ID CAE1-7owSRMas=T6e8c5mGQxLAegb42x0k26EQa5-8TcnoPthFQ@mail.gmail.com
State Committed
Commit 3a6de2b2db500d76ac141a6ef85d336bd0f8430b
Headers
Series [1/2] analyzer: show close event for use_after_close diagnostic |

Commit Message

Mir Immad July 5, 2022, 5:38 p.m. UTC
  From 3de908fa0c3e515b49df24460f85924211802d6c Mon Sep 17 00:00:00 2001
From: Immad Mir <mirimmad17@gmail.com>
Date: Tue, 5 Jul 2022 21:21:13 +0530
Subject: [PATCH 2/2] analyzer: reorder initialization of state m_invalid in
 sm-fd.cc [PR106184]

This patch reorders the initization of state m_invalid in sm-fd.cc
to conform with standard practice in C++.

gcc/analyzer/ChangeLog:
PR analyzer/106184
* sm-fd.cc (fd_state_machine): Change ordering of intilization
of state m_invalid.

Signed-off-by: Immad Mir <mirimmad17@gmail.com>
---
 gcc/analyzer/sm-fd.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

David Malcolm July 5, 2022, 8:52 p.m. UTC | #1
On Tue, 2022-07-05 at 23:08 +0530, Mir Immad wrote:
> From 3de908fa0c3e515b49df24460f85924211802d6c Mon Sep 17 00:00:00
> 2001
> From: Immad Mir <mirimmad17@gmail.com>
> Date: Tue, 5 Jul 2022 21:21:13 +0530
> Subject: [PATCH 2/2] analyzer: reorder initialization of state
> m_invalid in
>  sm-fd.cc [PR106184]
> 
> This patch reorders the initization of state m_invalid in sm-fd.cc
> to conform with standard practice in C++.
> 
> gcc/analyzer/ChangeLog:
> PR analyzer/106184
> * sm-fd.cc (fd_state_machine): Change ordering of intilization
> of state m_invalid.

Nit: "intilization" -> "intialization".

OK for trunk

Thanks
Dave
  

Patch

diff --git a/gcc/analyzer/sm-fd.cc b/gcc/analyzer/sm-fd.cc
index a85c95cc502..610261bdde5 100644
--- a/gcc/analyzer/sm-fd.cc
+++ b/gcc/analyzer/sm-fd.cc
@@ -551,11 +551,12 @@  fd_state_machine::fd_state_machine (logger *logger)
       m_unchecked_read_write (add_state ("fd-unchecked-read-write")),
       m_unchecked_read_only (add_state ("fd-unchecked-read-only")),
       m_unchecked_write_only (add_state ("fd-unchecked-write-only")),
-      m_invalid (add_state ("fd-invalid")),
       m_valid_read_write (add_state ("fd-valid-read-write")),
       m_valid_read_only (add_state ("fd-valid-read-only")),
       m_valid_write_only (add_state ("fd-valid-write-only")),
-      m_closed (add_state ("fd-closed")), m_stop (add_state ("fd-stop"))
+      m_invalid (add_state ("fd-invalid")),
+      m_closed (add_state ("fd-closed")),
+      m_stop (add_state ("fd-stop"))
 {
 }