diff mbox series

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

Message ID CY4PR1801MB1910816C25D4D033B6228AFFC6809@CY4PR1801MB1910.namprd18.prod.outlook.com
State New
Headers show
Series [1/3] analyzer: show close event for use_after_close diagnostic | expand

Commit Message

Immad Mir July 6, 2022, 2:25 p.m. UTC
From: Immad Mir <mirimmad17@gmail.com>

This patch reorders the initialization 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 initialization
	of state m_invalid.

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

Comments

David Malcolm July 6, 2022, 3:29 p.m. UTC | #1
On Wed, 2022-07-06 at 19:55 +0530, Immad Mir wrote:
> From: Immad Mir <mirimmad17@gmail.com>
> 
> This patch reorders the initialization of state m_invalid in sm-fd.cc
> to conform with standard practice in C++.

Might want to reword to say that the order of the initializers is now
the same as the ordering of the fields in the class decl, or somesuch.


I think I already approved this; it's OK to push this to trunk.

Thanks
Dave

> 
> 
> gcc/analyzer/ChangeLog:
>         PR analyzer/106184
>         * sm-fd.cc (fd_state_machine): Change ordering of
> initialization
>         of state m_invalid.
> 
> Signed-off-by: Immad Mir <mirimmad@outlook.com>
> ---
>  gcc/analyzer/sm-fd.cc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/analyzer/sm-fd.cc b/gcc/analyzer/sm-fd.cc
> index 8196d33223a..8e4300b06e2 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"))
>  {
>  }
>
diff mbox series

Patch

diff --git a/gcc/analyzer/sm-fd.cc b/gcc/analyzer/sm-fd.cc
index 8196d33223a..8e4300b06e2 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"))
 {
 }