riscvarchive / riscv-fesvr

RISC-V Frontend Server
Other
62 stars 83 forks source link

When parsing permissively, don't print to stderr #45

Closed seldridge closed 6 years ago

seldridge commented 6 years ago

This removes bool permissive from htif.cc, which was originally used to control whether or not htif was parsing arguments permissively. This instead uses getopt's builtin int opterr to hold this state. getopt then uses this to print/not print to stderr on unknown options.

Resultingly, unknown VCS options will not produce any stderr output.

From discussion in https://github.com/freechipsproject/rocket-chip/pull/1266#issuecomment-370890731.

seldridge commented 6 years ago

@ccelio: This should do what you want.

Some options that elucidate the change are below. Now, when a short option known to VCS, but unknown to htif shows up (e.g., -q) this only results in stderr output when not parsing permissively.