[Replicant] [libsamsung-ipc][PATCH 07/10] tools: nv_data-imei: Fix return-type compilation errors on Replicant 6.0

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Sat Feb 13 13:17:46 UTC 2021


In Replicant 6.0 we have:
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:
    In function 'main':
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:1064:1:
    error: control reaches end of non-void function [-Werror=return-type]

In nv_data-imei's main we had:
    int main(int argc, char * const argv[])
    {
        [...]
        assert(false);
    }
and for some reasons the Replicant 6.0 toolchain[1] doesn't recognize
that adding a 'return 0;' won't change anything, however doing
that is harmless and fixes that compilation error.

This issue also affected errno_to_sysexit in the same way:
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:
    In function 'errno_to_sysexit':
    hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:837:1: error:
    control reaches end of non-void function [-Werror=return-type]

[1] The compiler used (which is built by vendor/replicant/build-toolchain)
    returns the following when run with --version:
        arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 tools/nv_data-imei.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/nv_data-imei.c b/tools/nv_data-imei.c
index 5ba2a05..3ed335f 100644
--- a/tools/nv_data-imei.c
+++ b/tools/nv_data-imei.c
@@ -834,6 +834,8 @@ static int errno_to_sysexit(int err)
 		       err);
 		assert(false);
 	}
+
+	return 0;
 }
 
 int main(int argc, char * const argv[])
@@ -1061,4 +1063,6 @@ int main(int argc, char * const argv[])
 	}
 
 	assert(false);
+
+	return 0;
 }
-- 
2.30.1



More information about the Replicant mailing list