[LU-6540] too many arguments in a format string in lustre tests, lustre/tests/flock.c Created: 29/Apr/15  Updated: 14/Mar/17  Resolved: 21/Jul/15

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

Type: Bug Priority: Trivial
Reporter: Colin Ian King Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ubuntu 15.04, cppcheck static anaysis + GCC 4.9.2


Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Static analysis with cppcheck found the following issue in lustre/tests/flock.c:

Checking lustre/tests/flock.c...
[lustre/tests/flock.c:178]: (warning) printf format string requires 0 parameters but 1 is given.

fd = open(file, O_RDWR|O_CREAT, (mode_t)0666);
if (fd < 0)

{ printf("error open file: %m\n", file); exit(-1); }

The %m prints strerror(errno), but there is no %s specifier for the file. I believe a modern version GCC will flag this with a warning too.



 Comments   
Comment by Gerrit Updater [ 14/May/15 ]

Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14815
Subject: LU-6540 test: fix no %s specifier for the file
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 9de143f62ab1991ff5f9ff70dfafaf1728cc1af7

Comment by Gerrit Updater [ 21/Jul/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14815/
Subject: LU-6540 test: fix no %s specifier for the file
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: fb36d989168ea1794c8c0abb387982f857ed647f

Comment by Peter Jones [ 21/Jul/15 ]

Landed for 2.8

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