Bug 351857 - confusing error message about valid command line option
Summary: confusing error message about valid command line option
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-27 14:25 UTC by Florian Krohm
Modified: 2022-11-12 20:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Modify VG_BOOL_CLOM to print error if there is no "=something" (15.33 KB, patch)
2022-11-11 16:04 UTC, Paul Floyd
Details

Note You need to log in before you can comment on or make changes to this bug.
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.