I compiled my program with -fsanitize=address. Then I ran it with "ASAN_OPTIONS=help=1 ./q". I noticed that the output violates the GNU standards in a couple of ways. First, it doesn't word wrap at 80 characters. This makes it hard to read on a traditional 80-char terminal. Second, it prints to stderr, not stdout. This makes it needlessly hard to paginate.
Created attachment 37741 [details] Patch draft I've tried to sketch-up a simple patch that can do that. As the original source of the modified code is in LLVM project (which is merged to GCC), please create a PR in LLVM and I'll try to apply to patch to current LLVM trunk. The patch can be send eventually. Martin
Well, it looks llvm folk are not convinced about the behavior: http://reviews.llvm.org/D17566 Do we want to do it in the GCC anyway or not? Martin
You don't :) The agreement between the teams was that the code in gcc is a verbatim copy of upstream. (Well, there was a single-line difference at some point) If you break this assumption, the next merge will undo your change. Or the next merge will become impossible.
Then we have to agree that this code breaks GNU output style. Or it breaks LLVM output style. It is one or the other, I rather see a way to do this dynamically of breaking up the lines (this was done in the past for GCC's diagnostic so it definitely can be done).
(In reply to Andrew Pinski from comment #4) > Then we have to agree that this code breaks GNU output style. Or it breaks > LLVM output style. It is one or the other, I rather see a way to do this > dynamically of breaking up the lines (this was done in the past for GCC's > diagnostic so it definitely can be done). I like your idea, thus I've created a new version of pull request that directs the dump output format by a compiler macro (_GNU_HELP_OUTPUT). Enabling the macro in Makefile.{am,in} would be the only necessary change in GCC. Let's see what the LLVM folks will say about the change.
Well, the change was rejected by LLVM folks and I think it doesn't worth spending more time with that.