https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106133

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |dmalcolm at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-06-30

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
With -E the base_file_name == NULL. What about the following patch:

diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 22f7b0b6d6e..5d0137fd974 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -2246,6 +2246,9 @@ diagnostic_output_format_init (diagnostic_context
*context,
                               const char *base_file_name,
                               enum diagnostics_output_format format)
 {
+  if (base_file_name == NULL)
+    return;
+
   switch (format)
     {
     default:

David, what do you think?

Reply via email to