With:
    ./configure CC=clang CFLAGS=-W -Wall -Wno-unused \
                --no-create --no-recursion
we have:
    rfs.c:86:20: warning: comparison of integers of
    different signs: '__off_t' (aka 'long') and 'size_t'
    (aka 'unsigned int') [-Wsign-compare]
    if (st.st_size != size) {
        ~~~~~~~~~~ ^  ~~~~
    rfs.c:146:20: warning: comparison of integers of
    different signs: '__off_t' (aka 'long') and 'size_t'
    (aka 'unsigned int') [-Wsign-compare]
    if (st.st_size != size) {
        ~~~~~~~~~~ ^  ~~~~

This is caused by the following code:
    size_t size;
    [...]
    rc = stat([...], &st);
    if (st.st_size != size) {
      [...]
    }

However the type of size is wrong as the stat system call
returns a stat structure which has the following field:
    off_t     st_size;        /* Total size, in bytes */

Signed-off-by: Denis 'GNUtoo' Carikli <[email protected]>
---
 samsung-ipc/rfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/samsung-ipc/rfs.c b/samsung-ipc/rfs.c
index 1bf986f..fc134bf 100644
--- a/samsung-ipc/rfs.c
+++ b/samsung-ipc/rfs.c
@@ -66,7 +66,7 @@ int ipc_nv_data_path_check(struct ipc_client *client)
 {
     struct stat st;
     char *path;
-    size_t size;
+    off_t size;
     int rc;
 
     if (client == NULL)
@@ -126,7 +126,7 @@ int ipc_nv_data_backup_path_check(struct ipc_client *client)
 {
     struct stat st;
     char *backup_path;
-    size_t size;
+    off_t size;
     int rc;
 
     if (client == NULL)
-- 
2.25.0

_______________________________________________
Replicant mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/replicant

Reply via email to