Bug 351857

Summary: confusing error message about valid command line option
Product: [Developer tools] valgrind Reporter: Florian Krohm <flo2030>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: mark, pjfloyd
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Modify VG_BOOL_CLOM to print error if there is no "=something"

Description Florian Krohm 2015-08-27 14:25:11 UTC
$ valgrind --show-mismatched-frees ./xx

valgrind: Unknown option: --show-mismatched-frees

BS. Of course the option is known. What's wrong here is that it's missing a value, e.g.
--show-mismatched-frees=yes
The error message should say so.
Comment 1 Paul Floyd 2022-11-10 09:28:24 UTC
I've been bitten by this a few times as well.
Comment 2 Paul Floyd 2022-11-11 16:04:58 UTC
Created attachment 153677 [details]
Modify VG_BOOL_CLOM to print error if there is no "=something"

regtest clean, 5 new none/tests/cmdline* added
Comment 3 Mark Wielaard 2022-11-12 12:24:58 UTC
Patch looks good to me. Thanks.

+      VG_(fmsg_bad_option)(qq_arg,
+                           "Missing boolean value, did you mean '%s=yes'?\n",
+                           qq_arg);

We could consider (as a followup?) to just interpret this as =yes instead of having a warning.

Please just remove the old #define VG_BOOL_CLOM instead of #if 0 ...
Comment 4 Paul Floyd 2022-11-12 20:04:03 UTC
Fixed

To ssh://sourceware.org/git/valgrind.git
   ea9199739..ac6d9faf4  master -> master

I'll look at defaulting to 'yes' later.