From d350204357002041ad0cc0e4467097028ff9cb43 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Sun, 17 Jun 2018 10:41:33 +0200 Subject: [PATCH] chg: 60_fix-gcc-warnings.patch applied --- copy.c | 6 ++---- split.c | 5 +---- verify.c | 6 ++---- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/copy.c b/copy.c index 3027977..691de4c 100644 --- a/copy.c +++ b/copy.c @@ -223,8 +223,7 @@ int dd_copy(void) if (probe == PROBE_NONE || probed_size == 0) fprintf(stderr, "\r%llu blocks (%lluMb) written.", - /* [FIX] copy.c:226:25: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument {3,4} has type ‘uintmax_t’ [-Wformat=] */ - (long long unsigned int) w_full, (long long unsigned int) total_mb); + w_full, total_mb); else { time_t curr_time = time(NULL); int seconds = (int)difftime(curr_time, start_time); @@ -238,8 +237,7 @@ int dd_copy(void) time_left(secstr, sizeof secstr, seconds_remaining); fprintf(stderr, "\r[%d%% of %lluMb] %llu blocks (%lluMb) written. %s", - /* [FIX] copy.c:240:25: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument {4,5,6} has type ‘off_t’ [-Wformat=] */ - prcnt, (long long unsigned int) probed_mb, (long long unsigned int) w_full, (long long unsigned int) total_mb, secstr); + prcnt, probed_mb, w_full, total_mb, secstr); } } diff --git a/split.c b/split.c index 7bbb4d6..72db02f 100644 --- a/split.c +++ b/split.c @@ -102,10 +102,7 @@ static void open_split(split_t *split) char *ext, *fname; ext = getext(split->format, splitnum); - /* [FIX] split.c:105:5: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] */ - if( asprintf(&fname, "%s.%s", split->name, ext) == -1) { - return; - } + asprintf(&fname, "%s.%s", split->name, ext); free(ext); fd = open(fname, O_WRONLY | O_CREAT, perms); diff --git a/verify.c b/verify.c index 85d0d1a..38fbc24 100644 --- a/verify.c +++ b/verify.c @@ -192,8 +192,7 @@ int dd_verify(void) if (probe == PROBE_NONE || probed_size == 0) fprintf(stderr, "\r%llu blocks (%lluMb) written.", - /* [FIX] verify.c:195:25: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument {3,4} has type ‘uintmax_t’ [-Wformat=] */ - (long long unsigned int) w_full, (long long unsigned int) total_mb); + w_full, total_mb); else { time_t curr_time = time(NULL); int seconds = (int)difftime(curr_time, start_time); @@ -208,8 +207,7 @@ int dd_verify(void) time_left(secstr, sizeof secstr, seconds_remaining); fprintf(stderr, "\r[%d%% of %lluMb] %llu blocks (%lluMb) written. %s", - /* [FIX] verify.c:210:25: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument {4,5,6} has type ‘off_t’ [-Wformat=] */ - prcnt, (long long unsigned int) probed_mb, (long long unsigned int) w_full, (long long unsigned int) total_mb, secstr); + prcnt, probed_mb, w_full, total_mb, secstr); } }