diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-09 00:12:26 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-16 06:16:07 +0200 |
| commit | 518fd8c131c64e10b5762532141e0f31134ec20d (patch) | |
| tree | e29f72dd9e38995bce2c295c6a25b19274e01a65 /cgcc | |
| parent | a697a21927bddb091ba1a6d88c4db01ef2f58092 (diff) | |
| download | sparse-dev-518fd8c131c64e10b5762532141e0f31134ec20d.tar.gz | |
add support for -fdiagnostic-prefix[=prefix]
When using sparse it's common to compile a file and directly
run sparse on the same file, like it is done for the kernel.
In this case, error messages from sparse are interspersed with
those from the compiler. It's thus not always easy to know from
which tools they come.
Fix this by allowing to prefix all the diagnostic messages
by some configurable string, by default "sparse". More exactly,
an error message that was emitted like:
file.c:<line>:<col>: error: this is invalid code
can now be emitted as:
file.c:<line>:<col>: sparse: error: this is invalid code
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Reviewed-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Diffstat (limited to 'cgcc')
| -rwxr-xr-x | cgcc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -103,7 +103,7 @@ sub check_only_option { my ($arg) = @_; return 1 if $arg =~ /^-W(no-?)?(address-space|bitwise|cast-to-as|cast-truncate|context|decl|default-bitfield-sign|designated-init|do-while|enum-mismatch|init-cstring|memcpy-max-count|non-pointer-null|old-initializer|one-bit-signed-bitfield|override-init-all|paren-string|ptr-subtraction-blows|return-void|sizeof-bool|sparse-all|sparse-error|transparent-union|typesign|undef|unknown-attribute)$/; return 1 if $arg =~ /^-v(no-?)?(entry|dead)$/; - return 1 if $arg =~ /^-f(dump-ir|memcpy-max-count)(=\S*)?$/; + return 1 if $arg =~ /^-f(dump-ir|memcpy-max-count|diagnostic-prefix)(=\S*)?$/; return 1 if $arg =~ /^-f(mem2reg|optim)(-enable|-disable|=last)?$/; return 0; } |
