Skip to content

Include both option name & argument in invalid argument errors

Alan Coopersmith requested to merge alanc/x11perf:gcc-warnings into master

Found by gcc 14.1:

x11perf.c: In function ‘invalid_arg’:
x11perf.c:339:21: warning: too many arguments for format [-Wformat-extra-args]
  339 |     fprintf(stderr, "Error: invalid argument to %s\n", arg, option);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: e7a65459 ("When users give invalid arguments, tell them what they did wrong") from !10 (merged)

Merge request reports

Loading