summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2021-04-13 20:57:25 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2021-06-24 16:42:59 +0200
commit13f9aea38346b49f2828157fd56710eb08e79e8f (patch)
treeb7cb6d287bf86c1e07e12cad435896deb46e1d70 /python
parentlib: try CLOCK_THREAD_CPUTIME_ID (diff)
downloadfrr-13f9aea38346b49f2828157fd56710eb08e79e8f.tar.xz
frr-13f9aea38346b49f2828157fd56710eb08e79e8f.zip
build: add `-Werror` to xrelfo log format warnings
Adding a `\n' should now produce a warning. Controlled by `-Werror` so if you're doing a dev build and it's warning about some `prefix2str` that should be converted to `%pFX`, you can turn off `-Werror` to fix it later like with all other warnings. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'python')
-rw-r--r--python/xrelfo.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/xrelfo.py b/python/xrelfo.py
index 0ecd00857..17262da8d 100644
--- a/python/xrelfo.py
+++ b/python/xrelfo.py
@@ -357,6 +357,7 @@ def main():
argp.add_argument('--out-by-file', type=str, help='write by-file JSON output')
argp.add_argument('-Wlog-format', action='store_const', const=True)
argp.add_argument('-Wlog-args', action='store_const', const=True)
+ argp.add_argument('-Werror', action='store_const', const=True)
argp.add_argument('--profile', action='store_const', const=True)
argp.add_argument('binaries', metavar='BINARY', nargs='+', type=str, help='files to read (ELF files or libtool objects)')
args = argp.parse_args()
@@ -380,9 +381,12 @@ def _main(args):
traceback.print_exc()
for option in dir(args):
- if option.startswith('W'):
+ if option.startswith('W') and option != 'Werror':
checks = sorted(xrelfo.check(args))
sys.stderr.write(''.join([c[-1] for c in checks]))
+
+ if args.Werror and len(checks) > 0:
+ errors += 1
break