[Ocfs2-test-devel] [PATCH 1/2] Fix compiler warning that types don't match

zren at suse.com zren at suse.com
Thu Oct 8 19:08:51 PDT 2015


From: Eric Ren <zren at suse.com>

check_file_size_limits.c: In function ‘main’:
check_file_size_limits.c:231:2: warning: pointer targets in passing argument 3 of ‘parse_opts’ differ in signedness [-Wpointer-sign]
  if (parse_opts(argc, argv, &bbits, &cbits, &fname)) {
  ^
check_file_size_limits.c:112:12: note: expected ‘unsigned int *’ but argument is of type ‘int *’
 static int parse_opts(int argc, char **argv, unsigned int *bbits,
            ^
check_file_size_limits.c:231:2: warning: pointer targets in passing argument 4 of ‘parse_opts’ differ in signedness [-Wpointer-sign]
  if (parse_opts(argc, argv, &bbits, &cbits, &fname)) {
  ^
check_file_size_limits.c:112:12: note: expected ‘unsigned int *’ but argument is of type ‘int *’
 static int parse_opts(int argc, char **argv, unsigned int *bbits,
            ^

Signed-off-by: Eric Ren <zren at suse.com>
---
 programs/check_file_size_limits/check_file_size_limits.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/check_file_size_limits/check_file_size_limits.c b/programs/check_file_size_limits/check_file_size_limits.c
index c8a1e43..dfd438a 100644
--- a/programs/check_file_size_limits/check_file_size_limits.c
+++ b/programs/check_file_size_limits/check_file_size_limits.c
@@ -220,7 +220,7 @@ static int write_at_largest_off(int fd, unsigned long long max_off)
 int main(int argc, char **argv)
 {
 	int fd, ret;
-	int bbits = 0, cbits = 0;
+	unsigned int bbits = 0, cbits = 0;
 	char *fname = NULL;
 	unsigned long long max_off;
 
-- 
2.1.4




More information about the Ocfs2-test-devel mailing list