diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-09-13 23:32:57 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-11-24 13:51:24 +0100 |
| commit | 21df8a9d5763dfdcdec8b3e540d6c67459d75f74 (patch) | |
| tree | 7e75485b1cb86ed4c070a0adabfa263c625ece70 /sparse.c | |
| parent | fdf8252f312a40df9aa51c6e30c0d07fa29ebd12 (diff) | |
| download | sparse-dev-21df8a9d5763dfdcdec8b3e540d6c67459d75f74.tar.gz | |
teach sparse about '-o <file>'
Sparse knows about the '-o' option, parses it but does
nothing with it.
Change this by redirecting stdout to <file> unless <file>
is '-' since sparse (the lib) outputs to stdout by default.
But ignore this flag when sparse is used purely as an checker
since in this case it's not supposed to output to stdout
and would create undesired empty file, possibly erasing the
result of the compiler if one is used before sparse.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'sparse.c')
| -rw-r--r-- | sparse.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -334,6 +334,9 @@ int main(int argc, char **argv) struct string_list *filelist = NULL; char *file; + // by default ignore -o <file> + do_output = 0; + // Expand, linearize and show it. check_symbols(sparse_initialize(argc, argv, &filelist)); FOR_EACH_PTR(filelist, file) { |
