[alsa-devel] [PATCH 4/5] cplay: fix incorrect print specifier warning

Vinod Koul vinod.koul at intel.com
Thu Apr 19 08:36:19 CEST 2018


We get a warning in cplay for incorrect print specifier, fix it by using
right one %ld for long unsigned int.

cplay.c:327:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
   fprintf(stderr, "codec ID %d is not supported\n", codec_id);

Signed-off-by: Vinod Koul <vinod.koul at intel.com>
---
 src/utils/cplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/utils/cplay.c b/src/utils/cplay.c
index d2c60f976c6c..ea36b8771caf 100644
--- a/src/utils/cplay.c
+++ b/src/utils/cplay.c
@@ -324,7 +324,7 @@ void play_samples(char *name, unsigned int card, unsigned int device,
 		get_codec_iec(file, &config, &codec);
 		break;
 	default:
-		fprintf(stderr, "codec ID %d is not supported\n", codec_id);
+		fprintf(stderr, "codec ID %ld is not supported\n", codec_id);
 		exit(EXIT_FAILURE);
 	}
 
-- 
2.7.4



More information about the Alsa-devel mailing list