Blob Blame History Raw
commit 0ce349a220025a6f2bbdeb111dab2bcd88e1c374
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Thu May 18 15:58:53 2023 +0200

    [fix] Use RPMTAG_NOT_FOUND macro instead of -1
    
    In RPM 4.19, the internal representation of the rpmTagVal type has been
    changed from signed to unsigned.  That means, a plain check for the
    value of -1 (tag not found) returned from rpmTagGetValue() now produces
    a compiler warning.
    
    In order to fix that, we have to either explicitly cast the literal -1
    to (uint32_t)-1 or just use the RPMTAG_NOT_FOUND macro readily provided
    by RPM.
    
    Choose the latter since that's the supported way, really, it's also now
    documented as such in the API docs for the rpmTagGetValue() function.

diff --git a/lib/inspect_modularity.c b/lib/inspect_modularity.c
index 8b49421..3c96b1a 100644
--- a/lib/inspect_modularity.c
+++ b/lib/inspect_modularity.c
@@ -181,7 +181,7 @@ static bool modularity_driver(struct rpminspect *ri, rpmfile_entry_t *file)
 
     /* Find how to find the header */
     tv = rpmTagGetValue("modularitylabel");
-    if (tv == -1) {
+    if (tv == RPMTAG_NOT_FOUND) {
         add_result(ri, &params);
         free(params.msg);
         return false;