[LU-9803] Need to cast st_blksize to unsigned long for printf in directio.c Created: 27/Jul/17  Updated: 28/Aug/17  Resolved: 28/Aug/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.11.0

Type: Bug Priority: Minor
Reporter: Chris Horn Assignee: Chris Horn
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Had a compilation fail due:

directio.c: In function 'main':
directio.c:114:16: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type '__blksize_t' [-Werror=format=]
                st.st_blksize);
                ^


This is the code

        printf("directio on %s for %dx%lu bytes \n", fname, blocks,
               st.st_blksize);


Think we can get by with just casting that st_blksize to an unsigned long. I'll push a patch



 Comments   
Comment by Gerrit Updater [ 27/Jul/17 ]

Chris Horn (hornc@cray.com) uploaded a new patch: https://review.whamcloud.com/28262
Subject: LU-9803 tests: cast st_blksize for printf
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fbfd5c8f2c242b5befc40d88b29b7dbf4700e395

Comment by Gerrit Updater [ 28/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28262/
Subject: LU-9803 tests: cast st_blksize for printf
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 8784406f98dd4ddd98cec9cd728b70b22de3d1bf

Comment by Minh Diep [ 28/Aug/17 ]

Landed in 2.11

Generated at Sat Feb 10 02:29:25 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.