From 4844092066bb4e849d7dff3675d4d4a306df9b33 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 2 Nov 2023 13:02:57 -0700 Subject: [PATCH] init/host_init_verifier: Fix a compiler warning Fix the following compiler warning: //system/core/init:host_init_verifier clang++ host_init_verifier.cp system/core/init/host_init_verifier.cpp:112:9: warning: ISO C++ requires field designators to be specified in declaration order; field 'pw_shell' will be initialized after field 'pw_uid' [-Wreorder-init-list] .pw_uid = 0, ^~~~~~~~~~~ system/core/init/host_init_verifier.cpp:111:21: note: previous initialization for field 'pw_shell' is here .pw_shell = static_shell, ^~~~~~~~~~~~ Change-Id: I930c668d7fb1d12ebe9307b1549776da71a9a95a Signed-off-by: Bart Van Assche --- init/host_init_verifier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/host_init_verifier.cpp b/init/host_init_verifier.cpp index f070776ec..662185c44 100644 --- a/init/host_init_verifier.cpp +++ b/init/host_init_verifier.cpp @@ -108,9 +108,9 @@ passwd* getpwnam(const char* login) { // NOLINT: implementing bad function. static passwd static_passwd = { .pw_name = static_name, .pw_dir = static_dir, - .pw_shell = static_shell, .pw_uid = 0, .pw_gid = 0, + .pw_shell = static_shell, }; for (size_t n = 0; n < android_id_count; ++n) {