]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Support for 64-bit location_t: Analyzer parts
authorLewis Hyatt <lhyatt@gmail.com>
Mon, 28 Oct 2024 16:55:24 +0000 (12:55 -0400)
committerLewis Hyatt <lhyatt@gcc.gnu.org>
Sat, 23 Nov 2024 18:44:37 +0000 (13:44 -0500)
The analyzer occasionally prints internal location_t values for debugging;
adjust those parts so they will work if location_t is 64-bit. For
simplicity, to avoid hassling with the printf format string, just convert to
(unsigned long long) in either case.

gcc/analyzer/ChangeLog:

* checker-event.cc (checker_event::dump): Support printing either
32- or 64-bit location_t values.
* checker-path.cc (checker_path::inject_any_inlined_call_events):
Likewise.

gcc/analyzer/checker-event.cc
gcc/analyzer/checker-path.cc

index a7098ae19a138cc9f461167bb5e41316ccfe435e..0ba2a24773825b933c27b4727c880e9437d3ade8 100644 (file)
@@ -187,8 +187,8 @@ checker_event::dump (pretty_printer *pp) const
       if (m_effective_fndecl != m_original_fndecl)
        pp_printf (pp, " corrected from %qE", m_original_fndecl);
     }
-  pp_printf (pp, ", m_loc=%x)",
-            get_location ());
+  pp_printf (pp, ", m_loc=%llx)",
+            (unsigned long long) get_location ());
 }
 
 /* Dump this event to stderr (for debugging/logging purposes).  */
index fd3d6efae67e8273d38789b0018f11e25f3be477..649eb23ca17f0177037a8cd114b7b8a0dd9da449 100644 (file)
@@ -280,8 +280,9 @@ checker_path::inject_any_inlined_call_events (logger *logger)
              logger->log_partial ("  %qE", iter.get_block ());
              if (!flag_dump_noaddr)
                logger->log_partial (" (%p)", iter.get_block ());
-             logger->log_partial (", fndecl: %qE, callsite: 0x%x",
-                                  iter.get_fndecl (), iter.get_callsite ());
+             logger->log_partial (", fndecl: %qE, callsite: 0x%llx",
+                                  iter.get_fndecl (),
+                                  (unsigned long long) iter.get_callsite ());
              if (iter.get_callsite ())
                dump_location (logger->get_printer (), iter.get_callsite ());
              logger->end_log_line ();