[PATCH] D42361: [Tooling] Returns non-zero status code when files are skipped.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 1 05:42:45 PST 2018


ioeric added inline comments.


================
Comment at: lib/Tooling/Tooling.cpp:404
     if (CompileCommandsForFile.empty()) {
       // FIXME: There are two use cases here: doing a fuzzy
       // "find . -name '*.cc' |xargs tool" match, where as a user I don't care
----------------
bkramer wrote:
> ioeric wrote:
> > bkramer wrote:
> > > This comment explains why the implementation doesn't error. Can you make sure the xargs use case is still working properly?
> > I somehow missed the big `FIXME`... thanks for the catch! 
> > 
> > I don't think this is a very typical use case that should affect design decision here, and I would expect `xargs` users to do something like `xargs tool $@ || true` if they really want to ignore errors. WDYT?
> Yeah. I think the only important thing is that xargs doesn't stop after the first error. But that seems to be the default behavior of xargs?
Looks like this is the case, from the manual:
```
If  any  invocation of the command exits with a status of 255, xargs will stop immediately without reading any further input.  An error message is issued on stderr when this happens.
```

Should I just remove the FIXME?


Repository:
  rC Clang

https://reviews.llvm.org/D42361





More information about the cfe-commits mailing list