Skip to content

Commit

Permalink
perf tools: Document the fact that parse_options*() may exit
Browse files Browse the repository at this point in the history
Generally, calling exit() from a library is bad practice.  Eventually
these functions might be redesigned so that they don't exit.  For now,
just document the fact that they do.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/97b1af06cc3b18dd0f49e655d6d659eaa64ecde5.1450193761.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Josh Poimboeuf authored and Arnaldo Carvalho de Melo committed Dec 16, 2015
1 parent ce99091 commit 24a88bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/perf/util/parse-options.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ struct option {
/* parse_options() will filter out the processed options and leave the
* non-option argments in argv[].
* Returns the number of arguments left in argv[].
*
* NOTE: parse_options() and parse_options_subcommand() may call exit() in the
* case of an error (or for 'special' options like --list-cmds or --list-opts).
*/
extern int parse_options(int argc, const char **argv,
const struct option *options,
Expand Down

0 comments on commit 24a88bd

Please sign in to comment.