[5/9] tools/abilint: Fix --annotate when reading free form translation units

Message ID 877bmcpcj7.fsf@seketeli.org
State New
Headers
Series [1/9] tests/mockfedabipkgdiff.in: Fix python module loading |

Commit Message

Dodji Seketeli July 30, 2026, 6:17 p.m. UTC
  Hello,

It turned out "abilint --annotate" does not annotate the emitted ABIXML
if it is a free-form translation unit rather than a full-blown ABI
corpus.  Fixed thus.

	* tools/abilint.cc (main): When reading free form translation
	units, call set_annotate on the write context before calling
	write_translation_unit, so that the --annotate option is properly
	honoured.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>

Applied to the master branch.
---
 tools/abilint.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/tools/abilint.cc b/tools/abilint.cc
index 22ac20ae..811d72e7 100644
--- a/tools/abilint.cc
+++ b/tools/abilint.cc
@@ -893,7 +893,10 @@  main(int argc, char* argv[])
       if (tu)
 	{
 	  if (!opts.noout)
-	    is_ok = write_translation_unit(*ctxt, *tu, 0);
+	    {
+	      set_annotate(*ctxt, opts.annotate);
+	      is_ok = write_translation_unit(*ctxt, *tu, 0);
+	    }
 	}
       else
 	{