diff options
| -rw-r--r-- | lib/subdir.am | 2 | ||||
| -rw-r--r-- | python/xrelfo.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/subdir.am b/lib/subdir.am index b4ba078e46..90301d800a 100644 --- a/lib/subdir.am +++ b/lib/subdir.am @@ -464,7 +464,7 @@ endif SUFFIXES += .xref %.xref: % $(CLIPPY) - $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(XRELFO_FLAGS) -o $@ $< + $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $< # dependencies added in python/makefile.py frr.xref: diff --git a/python/xrelfo.py b/python/xrelfo.py index 0ecd008579..17262da8d9 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 |
