[PATCH] D121159: llvm-nm should flush and error check output

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 21:39:46 PST 2022


jhenderson requested changes to this revision.
jhenderson added a comment.
This revision now requires changes to proceed.

The pre-merge check is  failing to build this patch.

There are loads of LLVM tools that print to stdout. This "fixes" just one of them. If there is an issue, it's in all the tools, so needs patching somewhere else. I'm also not convinced it should be needed:

1. `returm 0` is implicit at the end of main (see the accepted answer to this question: https://stackoverflow.com/questions/204476/what-should-main-return-in-c-and-c).
2. stdout is flushed on exit automatically: https://stackoverflow.com/questions/15911517/is-there-a-guarantee-of-stdout-auto-flush-before-exit-how-does-it-work

How does explicit flushing help us with output errors. More importantly, why do we care?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121159/new/

https://reviews.llvm.org/D121159



More information about the llvm-commits mailing list