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

            Bug ID: 122151
           Summary: analyzer fails to build with g++ 5.5
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 62496
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62496&action=edit
tentative patch, but not enough

Using current master, gcc fails to build using gcc 5.5:

```
g++ -std=gnu++14  -fno-PIE -c   -g -O2     -DIN_GCC    -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing
-Wwrite-strings -Wcast-qual   -DHAVE_CONFIG_H -fno-PIE -I. -Idiagnostics
-I../../gcc/gcc -I../../gcc/gcc/diagnostics -I../../gcc/gcc/../include 
-I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody 
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber -I../../gcc/gcc/../libbacktrace   -o
diagnostics/option-classifier.o -MT diagnostics/option-classifier.o -MMD -MP
-MF diagnostics/.deps/option-classifier.TPo
../../gcc/gcc/diagnostics/option-classifier.cc
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/analyzer/common.h:30,
                 from ../../gcc/gcc/analyzer/sm-malloc.cc:21:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:77:56: error:
specialization of ‘template<class EnumType> static
json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value()’ in different namespace
[-fpermissive]
 json::enum_traits<enum node::kind>::get_unknown_value ()
                                                        ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:148:17: error:   from definition of ‘template<class
EnumType> static json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value()’ [-fpermissive]
   static enum_t get_unknown_value ();
                 ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc: In static member
function ‘static json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value() [with EnumType =
custom_sarif_properties::state_graphs::node::kind;
json::enum_traits<EnumType>::enum_t =
custom_sarif_properties::state_graphs::node::kind]’:
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:79:16: error:
‘node::kind’ is not a class, namespace, or enumeration
   return node::kind::other;
                ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc: At global scope:
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:102:20: error:
specialization of ‘template<class EnumType> static bool
json::enum_traits<EnumType>::maybe_get_value_from_string(const char*,
json::enum_traits<EnumType>::enum_t&)’ in different namespace [-fpermissive]
         enum_t &out)
                    ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:149:15: error:   from definition of ‘template<class
EnumType> static bool
json::enum_traits<EnumType>::maybe_get_value_from_string(const char*,
json::enum_traits<EnumType>::enum_t&)’ [-fpermissive]
   static bool maybe_get_value_from_string (const char *, enum_t &out);
               ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:115:71: error:
specialization of ‘template<class EnumType> static const char*
json::enum_traits<EnumType>::get_string_for_value(json::enum_traits<EnumType>::enum_t)’
in different namespace [-fpermissive]
 json::enum_traits<enum node::kind>::get_string_for_value (enum_t value)
                                                                       ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:150:22: error:   from definition of ‘template<class
EnumType> static const char*
json::enum_traits<EnumType>::get_string_for_value(json::enum_traits<EnumType>::enum_t)’
[-fpermissive]
   static const char *get_string_for_value (enum_t value);
                      ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:124:66: error:
specialization of ‘template<class EnumType> static
json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value()’ in different namespace
[-fpermissive]
 json::enum_traits<enum node::dynalloc_state>::get_unknown_value ()
                                                                  ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:148:17: error:   from definition of ‘template<class
EnumType> static json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value()’ [-fpermissive]
   static enum_t get_unknown_value ();
                 ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc: In static member
function ‘static json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value() [with EnumType =
custom_sarif_properties::state_graphs::node::dynalloc_state;
json::enum_traits<EnumType>::enum_t =
custom_sarif_properties::state_graphs::node::dynalloc_state]’:
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:126:16: error:
‘node::dynalloc_state’ is not a class, namespace, or enumeration
   return node::dynalloc_state::unknown;
                ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc: At global scope:
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:140:20: error:
specialization of ‘template<class EnumType> static bool
json::enum_traits<EnumType>::maybe_get_value_from_string(const char*,
json::enum_traits<EnumType>::enum_t&)’ in different namespace [-fpermissive]
         enum_t &out)
                    ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:149:15: error:   from definition of ‘template<class
EnumType> static bool
json::enum_traits<EnumType>::maybe_get_value_from_string(const char*,
json::enum_traits<EnumType>::enum_t&)’ [-fpermissive]
   static bool maybe_get_value_from_string (const char *, enum_t &out);
               ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:154:35: error:
specialization of ‘template<class EnumType> static const char*
json::enum_traits<EnumType>::get_string_for_value(json::enum_traits<EnumType>::enum_t)’
in different namespace [-fpermissive]
 get_string_for_value (enum_t value)
                                   ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:150:22: error:   from definition of ‘template<class
EnumType> static const char*
json::enum_traits<EnumType>::get_string_for_value(json::enum_traits<EnumType>::enum_t)’
[-fpermissive]
   static const char *get_string_for_value (enum_t value);
                      ^
make[2]: *** [Makefile:1210: custom-sarif-properties/state-graphs.o] Error 1
make[2]: *** Waiting for unfinished jobs....
../../gcc/gcc/diagnostics/output-spec.cc: In member function ‘void
diagnostics::output_spec::context::report_unknown_key(const string&, const
diagnostics::output_spec::scheme_handler&) const’:
../../gcc/gcc/diagnostics/output-spec.cc:268:37: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
       &e_scheme_keys, &e_client_keys);
                                     ^
../../gcc/gcc/diagnostics/output-spec.cc:268:37: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
../../gcc/gcc/diagnostics/output-spec.cc:268:37: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/output-spec.cc:276:47: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
      key.c_str (), scheme_name, &e_scheme_keys);
                                               ^
../../gcc/gcc/diagnostics/output-spec.cc:276:47: warning: too many arguments
for format [-Wformat-extra-args]
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/diagnostics/macro-unwinding.cc:23:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
../../gcc/gcc/diagnostics/output-spec.cc: In member function
‘std::unique_ptr<diagnostics::sink>
diagnostics::output_spec::output_factory::make_sink(const
diagnostics::output_spec::context&, diagnostics::context&, const
diagnostics::output_spec::scheme_name_and_params&)’:
../../gcc/gcc/diagnostics/output-spec.cc:402:46: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
     scheme_and_kvs.m_scheme_name.c_str (), &e);
                                              ^
../../gcc/gcc/diagnostics/output-spec.cc:402:46: warning: too many arguments
for format [-Wformat-extra-args]
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/analyzer/common.h:30,
                 from
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:24:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/analyzer/common.h:30,
                 from ../../gcc/gcc/analyzer/program-state.cc:21:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/analyzer/common.h:30,
                 from ../../gcc/gcc/analyzer/checker-event.cc:21:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
../../gcc/gcc/diagnostics/output-spec.cc: In instantiation of
‘diagnostics::output_spec::key_handler::result
diagnostics::output_spec::key_handler::parse_enum_value(const
diagnostics::output_spec::context&, const string&, const string&, const
std::array<std::pair<const char*, EnumType>, NumValues>&, EnumType&) const
[with EnumType = diagnostics::sarif_serialization_kind; long unsigned int
NumValues = 1ul; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
../../gcc/gcc/diagnostics/output-spec.cc:554:23:   required from here
../../gcc/gcc/diagnostics/output-spec.cc:140:5: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
     ("%<%s%s%>:"
     ^
../../gcc/gcc/diagnostics/output-spec.cc:140:5: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/output-spec.cc: In instantiation of
‘diagnostics::output_spec::key_handler::result
diagnostics::output_spec::key_handler::parse_enum_value(const
diagnostics::output_spec::context&, const string&, const string&, const
std::array<std::pair<const char*, EnumType>, NumValues>&, EnumType&) const
[with EnumType = diagnostics::sarif_version; long unsigned int NumValues = 2ul;
std::__cxx11::string = std::__cxx11::basic_string<char>]’:
../../gcc/gcc/diagnostics/output-spec.cc:566:30:   required from here
../../gcc/gcc/diagnostics/output-spec.cc:140:5: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
../../gcc/gcc/diagnostics/output-spec.cc:140:5: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/html-sink.cc: In function ‘void
diagnostics::selftest::test_token_printer()’:
../../gcc/gcc/diagnostics/html-sink.cc:1606:48: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
     pp_printf (&t.m_pp, "foo %@ bar", &event_id);
                                                ^
../../gcc/gcc/diagnostics/html-sink.cc:1606:48: warning: too many arguments for
format [-Wformat-extra-args]
In file included from ../../gcc/gcc/diagnostics/digraphs.cc:448:0:
../../gcc/gcc/diagnostics/digraphs.cc: In function ‘void
diagnostics::selftest::test_property_objects()’:
../../gcc/gcc/diagnostics/digraphs.cc:557:30: error:
‘state_node_properties::kind’ is not a class, namespace, or enumeration
       state_node_properties::kind::other);
                              ^
../../gcc/gcc/selftest.h:331:18: note: in definition of macro ‘ASSERT_EQ_AT’
   if ((VAL1) == (VAL2))           \
                  ^
../../gcc/gcc/diagnostics/digraphs.cc:556:3: note: in expansion of macro
‘ASSERT_EQ’
   ASSERT_EQ (node.get_property (state_node_properties::kind),
   ^
../../gcc/gcc/diagnostics/digraphs.cc:559:31: error:
‘state_node_properties::kind’ is not a class, namespace, or enumeration
        state_node_properties::kind::stack);
                               ^
In file included from ../../gcc/gcc/diagnostics/digraphs.cc:448:0:
../../gcc/gcc/diagnostics/digraphs.cc:561:30: error:
‘state_node_properties::kind’ is not a class, namespace, or enumeration
       state_node_properties::kind::stack);
                              ^
../../gcc/gcc/selftest.h:331:18: note: in definition of macro ‘ASSERT_EQ_AT’
   if ((VAL1) == (VAL2))           \
                  ^
../../gcc/gcc/diagnostics/digraphs.cc:560:3: note: in expansion of macro
‘ASSERT_EQ’
   ASSERT_EQ (node.get_property (state_node_properties::kind),
   ^
../../gcc/gcc/diagnostics/digraphs.cc:564:30: error:
‘state_node_properties::dynalloc_state’ is not a class, namespace, or
enumeration
       state_node_properties::dynalloc_state::unknown);
                              ^
../../gcc/gcc/selftest.h:331:18: note: in definition of macro ‘ASSERT_EQ_AT’
   if ((VAL1) == (VAL2))           \
                  ^
../../gcc/gcc/diagnostics/digraphs.cc:563:3: note: in expansion of macro
‘ASSERT_EQ’
   ASSERT_EQ (node.get_property (state_node_properties::dynalloc_state),
   ^
../../gcc/gcc/diagnostics/digraphs.cc:566:31: error:
‘state_node_properties::dynalloc_state’ is not a class, namespace, or
enumeration
        state_node_properties::dynalloc_state::freed);
                               ^
In file included from ../../gcc/gcc/diagnostics/digraphs.cc:448:0:
../../gcc/gcc/diagnostics/digraphs.cc:568:30: error:
‘state_node_properties::dynalloc_state’ is not a class, namespace, or
enumeration
       state_node_properties::dynalloc_state::freed);
                              ^
../../gcc/gcc/selftest.h:331:18: note: in definition of macro ‘ASSERT_EQ_AT’
   if ((VAL1) == (VAL2))           \
                  ^
../../gcc/gcc/diagnostics/digraphs.cc:567:3: note: in expansion of macro
‘ASSERT_EQ’
   ASSERT_EQ (node.get_property (state_node_properties::dynalloc_state),
   ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc: In member function
‘std::unique_ptr<diagnostics::digraphs::node>
ana::analyzer_state_graph::create_state_node(const ana::region&)’:
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:315:43: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
  node = make_state_node (node_properties::kind::stack_frame,
                                           ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:331:29: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
            node_properties::kind::globals);
                             ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:335:29: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
            node_properties::kind::code);
                             ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:339:29: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
            node_properties::kind::function);
                             ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:345:29: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
            node_properties::kind::stack);
                             ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:349:29: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
            node_properties::kind::heap_);
                             ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:353:29: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
            node_properties::kind::thread_local_);
                             ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:360:29: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
            node_properties::kind::other);
                             ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:365:43: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
  node = make_state_node (node_properties::kind::variable,
                                           ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:397:48: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
       node = make_state_node (node_properties::kind::other,
                                                ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:404:29: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
            node_properties::kind::dynalloc_buffer);
                             ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc: In member function
‘std::unique_ptr<diagnostics::digraphs::node>
ana::analyzer_state_graph::create_state_node_for_conc_bindings(const
concrete_bindings_t&)’:
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:475:49: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
   auto node = make_state_node (node_properties::kind::other,
                                                 ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:482:38: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
  = make_state_node (node_properties::kind::other,
                                      ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc: In member function
‘void
ana::analyzer_state_graph::populate_state_node_for_typed_region(diagnostics::digraphs::node&,
const ana::region&, const concrete_bindings_t&, bool)’:
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:571:27: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
         (node_properties::kind::element,
                           ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:604:24: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
      (node_properties::kind::padding,
                        ^
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:623:24: error:
‘ana::node_properties::kind’ is not a class, namespace, or enumeration
      (node_properties::kind::field,
                        ^
make[2]: *** [Makefile:1210: diagnostics/digraphs.o] Error 1
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::mismatching_deallocation::describe_final_event(pretty_printer&,
const ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:907:32: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        expected_dealloc->m_name);
                                ^
../../gcc/gcc/analyzer/sm-malloc.cc:907:32: warning: format ‘%s’ expects
argument of type ‘char*’, but argument 4 has type
‘diagnostics::paths::event_id_t* {aka diagnostic_event_id_t*}’ [-Wformat=]
../../gcc/gcc/analyzer/sm-malloc.cc:907:32: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc:912:48: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        m_actual_dealloc->m_name, &m_alloc_event);
                                                ^
../../gcc/gcc/analyzer/sm-malloc.cc:912:48: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::double_free::describe_final_event(pretty_printer&, const
ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:984:23: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
    &m_first_free_event);
                       ^
../../gcc/gcc/analyzer/sm-malloc.cc:984:23: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::possible_null_deref::describe_final_event(pretty_printer&,
const ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1069:32: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
    &m_origin_of_unchecked_event);
                                ^
../../gcc/gcc/analyzer/sm-malloc.cc:1069:32: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::possible_null_arg::describe_final_event(pretty_printer&,
const ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1167:32: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
    &m_origin_of_unchecked_event);
                                ^
../../gcc/gcc/analyzer/sm-malloc.cc:1167:32: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::use_after_free::describe_final_event(pretty_printer&, const
ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1379:42: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        funcname, ev.m_expr, &m_free_event);
                                          ^
../../gcc/gcc/analyzer/sm-malloc.cc:1379:42: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc:1384:42: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        funcname, ev.m_expr, &m_free_event);
                                          ^
../../gcc/gcc/analyzer/sm-malloc.cc:1384:42: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc:1390:42: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        funcname, ev.m_expr, &m_free_event);
                                          ^
../../gcc/gcc/analyzer/sm-malloc.cc:1390:42: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::malloc_leak::describe_final_event(pretty_printer&, const
ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1478:33: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        ev.m_expr, &m_alloc_event);
                                 ^
../../gcc/gcc/analyzer/sm-malloc.cc:1478:33: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc:1488:35: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        "<unknown>", &m_alloc_event);
                                   ^
../../gcc/gcc/analyzer/sm-malloc.cc:1488:35: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::deref_before_check::describe_final_event(pretty_printer&,
const ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1734:31: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
    m_arg, &m_first_deref_event);
                               ^
../../gcc/gcc/analyzer/sm-malloc.cc:1734:31: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/sarif-sink.cc: In function ‘void
diagnostics::selftest::test_message_with_embedded_link(const
diagnostics::sarif_generation_options&)’:
../../gcc/gcc/diagnostics/sarif-sink.cc:4988:29: warning: unknown conversion
type character ‘{’ in format [-Wformat=]
         "http://example.com";);
                             ^
../../gcc/gcc/diagnostics/sarif-sink.cc:4988:29: warning: unknown conversion
type character ‘}’ in format [-Wformat=]
../../gcc/gcc/diagnostics/sarif-sink.cc:4988:29: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/sarif-sink.cc:5011:12: warning: unknown conversion
type character ‘{’ in format [-Wformat=]
         "1");
            ^
../../gcc/gcc/diagnostics/sarif-sink.cc:5011:12: warning: unknown conversion
type character ‘}’ in format [-Wformat=]
../../gcc/gcc/diagnostics/sarif-sink.cc:5011:12: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/analyzer/checker-event.cc: In member function ‘virtual void
ana::rewind_to_setjmp_event::print_desc(pretty_printer&) const’:
../../gcc/gcc/analyzer/checker-event.cc:1125:33: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
      &m_original_setjmp_event_id);
                                 ^
../../gcc/gcc/analyzer/checker-event.cc:1125:33: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/analyzer/checker-event.cc:1131:33: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
      &m_original_setjmp_event_id);
                                 ^
../../gcc/gcc/analyzer/checker-event.cc:1131:33: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In function
‘custom_sarif_properties::state_graphs::node::dynalloc_state
ana::{anonymous}::get_dynalloc_state_for_state(ana::{anonymous}::resource_state)’:
../../gcc/gcc/analyzer/sm-malloc.cc:2749:37: error:
‘ana::state_node_properties::dynalloc_state’ is not a class, namespace, or
enumeration
       return state_node_properties::dynalloc_state::unknown;
                                     ^
../../gcc/gcc/analyzer/sm-malloc.cc:2752:37: error:
‘ana::state_node_properties::dynalloc_state’ is not a class, namespace, or
enumeration
       return state_node_properties::dynalloc_state::nonnull;
                                     ^
../../gcc/gcc/analyzer/sm-malloc.cc:2755:37: error:
‘ana::state_node_properties::dynalloc_state’ is not a class, namespace, or
enumeration
       return state_node_properties::dynalloc_state::unchecked;
                                     ^
../../gcc/gcc/analyzer/sm-malloc.cc:2757:37: error:
‘ana::state_node_properties::dynalloc_state’ is not a class, namespace, or
enumeration
       return state_node_properties::dynalloc_state::nonnull;
                                     ^
../../gcc/gcc/analyzer/sm-malloc.cc:2759:37: error:
‘ana::state_node_properties::dynalloc_state’ is not a class, namespace, or
enumeration
       return state_node_properties::dynalloc_state::freed;
                                     ^
make[2]: *** [Makefile:1210: analyzer/ana-state-to-diagnostic-state.o] Error 1
make[2]: *** [Makefile:1210: analyzer/sm-malloc.o] Error 1
make[2]: Leaving directory '/home/poulhies/git/gnat2fsf/build/gcc'
make[1]: *** [Makefile:4722: all-gcc] Error 2
make[1]: Leaving directory '/home/poulhies/git/gnat2fsf/build'
make: *** [Makefile:1064: all] Error 2
```

Using the attached patch from David fixes some errors, but still fails with the
following errors:
```
g++ -std=gnu++14  -fno-PIE -c   -g -O2     -DIN_GCC    -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings  -DHAVE_CONFIG_H -fno-PIE -I. -I.
-I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include 
-I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody 
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber -I../../gcc/gcc/../libbacktrace   -o gcc-diagnostic-spec.o
-MT gcc-diagnostic-spec.o -MMD -MP -MF ./.deps/gcc-diagnostic-spec.TPo
../../gcc/gcc/gcc-diagnostic-spec.cc
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:77:58: error:
specialization of ‘template<class EnumType> static
json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value()’ in different namespace
[-fpermissive]
 json::enum_traits<enum node::kind_t>::get_unknown_value ()
                                                          ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:148:17: error:   from definition of ‘template<class
EnumType> static json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value()’ [-fpermissive]
   static enum_t get_unknown_value ();
                 ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:102:20: error:
specialization of ‘template<class EnumType> static bool
json::enum_traits<EnumType>::maybe_get_value_from_string(const char*,
json::enum_traits<EnumType>::enum_t&)’ in different namespace [-fpermissive]
         enum_t &out)
                    ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:149:15: error:   from definition of ‘template<class
EnumType> static bool
json::enum_traits<EnumType>::maybe_get_value_from_string(const char*,
json::enum_traits<EnumType>::enum_t&)’ [-fpermissive]
   static bool maybe_get_value_from_string (const char *, enum_t &out);
               ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:115:73: error:
specialization of ‘template<class EnumType> static const char*
json::enum_traits<EnumType>::get_string_for_value(json::enum_traits<EnumType>::enum_t)’
in different namespace [-fpermissive]
 json::enum_traits<enum node::kind_t>::get_string_for_value (enum_t value)
                                                                         ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:150:22: error:   from definition of ‘template<class
EnumType> static const char*
json::enum_traits<EnumType>::get_string_for_value(json::enum_traits<EnumType>::enum_t)’
[-fpermissive]
   static const char *get_string_for_value (enum_t value);
                      ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:124:68: error:
specialization of ‘template<class EnumType> static
json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value()’ in different namespace
[-fpermissive]
 json::enum_traits<enum node::dynalloc_state_t>::get_unknown_value ()
                                                                    ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:148:17: error:   from definition of ‘template<class
EnumType> static json::enum_traits<EnumType>::enum_t
json::enum_traits<EnumType>::get_unknown_value()’ [-fpermissive]
   static enum_t get_unknown_value ();
                 ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:140:20: error:
specialization of ‘template<class EnumType> static bool
json::enum_traits<EnumType>::maybe_get_value_from_string(const char*,
json::enum_traits<EnumType>::enum_t&)’ in different namespace [-fpermissive]
         enum_t &out)
                    ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:149:15: error:   from definition of ‘template<class
EnumType> static bool
json::enum_traits<EnumType>::maybe_get_value_from_string(const char*,
json::enum_traits<EnumType>::enum_t&)’ [-fpermissive]
   static bool maybe_get_value_from_string (const char *, enum_t &out);
               ^
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:154:35: error:
specialization of ‘template<class EnumType> static const char*
json::enum_traits<EnumType>::get_string_for_value(json::enum_traits<EnumType>::enum_t)’
in different namespace [-fpermissive]
 get_string_for_value (enum_t value)
                                   ^
In file included from
../../gcc/gcc/custom-sarif-properties/state-graphs.cc:24:0:
../../gcc/gcc/json.h:150:22: error:   from definition of ‘template<class
EnumType> static const char*
json::enum_traits<EnumType>::get_string_for_value(json::enum_traits<EnumType>::enum_t)’
[-fpermissive]
   static const char *get_string_for_value (enum_t value);
                      ^
g++ -std=gnu++14  -fno-PIE -c   -g -O2     -DIN_GCC    -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings  -DHAVE_CONFIG_H -fno-PIE -I. -I.
-I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include 
-I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody 
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber -I../../gcc/gcc/../libbacktrace   -o graphviz.o -MT
graphviz.o -MMD -MP -MF ./.deps/graphviz.TPo ../../gcc/gcc/graphviz.cc
make[2]: *** [Makefile:1210: custom-sarif-properties/state-graphs.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/analyzer/common.h:30,
                 from ../../gcc/gcc/analyzer/program-state.cc:21:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/analyzer/common.h:30,
                 from ../../gcc/gcc/analyzer/sm-malloc.cc:21:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/analyzer/common.h:30,
                 from ../../gcc/gcc/analyzer/checker-event.cc:21:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
../../gcc/gcc/diagnostics/paths-output.cc: In member function ‘virtual
label_text {anonymous}::path_label::get_text(unsigned int) const’:
../../gcc/gcc/diagnostics/paths-output.cc:115:42: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
     pp_printf (pp.get (), "%@", &event_id);
                                          ^
../../gcc/gcc/diagnostics/paths-output.cc:115:42: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/paths-output.cc: In member function ‘void
{anonymous}::event_range::print_as_text(pretty_printer&,
diagnostics::text_sink&, diagnostics::source_effect_info*)’:
../../gcc/gcc/diagnostics/paths-output.cc:632:40: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
      pp_printf (&pp, " %@: ", &event_id);
                                        ^
../../gcc/gcc/diagnostics/paths-output.cc:632:40: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/paths-output.cc: In member function ‘void
{anonymous}::event_range::print_as_html(xml::printer&, diagnostics::context&,
diagnostics::source_effect_info*, diagnostics::html_label_writer*)’:
../../gcc/gcc/diagnostics/paths-output.cc:691:40: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
      pp_printf (&pp, " %@: ", &event_id);
                                        ^
../../gcc/gcc/diagnostics/paths-output.cc:691:40: warning: too many arguments
for format [-Wformat-extra-args]
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/analyzer/common.h:30,
                 from
../../gcc/gcc/analyzer/ana-state-to-diagnostic-state.cc:24:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
../../gcc/gcc/diagnostics/paths-output.cc: In member function ‘void
diagnostics::text_sink::print_path(const diagnostics::paths::path&)’:
../../gcc/gcc/diagnostics/paths-output.cc:1342:32: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
        name.get (), stack_depth);
                                ^
../../gcc/gcc/diagnostics/paths-output.cc:1342:32: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
../../gcc/gcc/diagnostics/paths-output.cc:1342:32: warning: format ‘%s’ expects
argument of type ‘char*’, but argument 3 has type ‘diagnostic_event_id_t*’
[-Wformat=]
../../gcc/gcc/diagnostics/paths-output.cc:1342:32: warning: format ‘%i’ expects
argument of type ‘int’, but argument 4 has type ‘element_event_desc*’
[-Wformat=]
../../gcc/gcc/diagnostics/paths-output.cc:1342:32: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/paths-output.cc:1348:17: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
      stack_depth);
                 ^
../../gcc/gcc/diagnostics/paths-output.cc:1348:17: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
../../gcc/gcc/diagnostics/paths-output.cc:1348:17: warning: format ‘%i’ expects
argument of type ‘int’, but argument 3 has type ‘diagnostic_event_id_t*’
[-Wformat=]
../../gcc/gcc/diagnostics/paths-output.cc:1348:17: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/diagnostics/paths-output.cc:1352:42: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
         "%@ %e", &event_id, &e_event_desc);
                                          ^
../../gcc/gcc/diagnostics/paths-output.cc:1352:42: warning: unknown conversion
type character ‘e’ in format [-Wformat=]
../../gcc/gcc/diagnostics/paths-output.cc:1352:42: warning: too many arguments
for format [-Wformat-extra-args]
In file included from ../../gcc/gcc/tree.h:23:0,
                 from ../../gcc/gcc/gcc-diagnostic-spec.cc:27:
../../gcc/gcc/tree-core.h:2085:48: warning: ‘tree_function_decl::decl_type’ is
too small to hold all values of ‘enum class function_decl_type’
   ENUM_BITFIELD(function_decl_type) decl_type: 2;
                                                ^
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::mismatching_deallocation::describe_final_event(pretty_printer&,
const ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:907:32: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        expected_dealloc->m_name);
                                ^
../../gcc/gcc/analyzer/sm-malloc.cc:907:32: warning: format ‘%s’ expects
argument of type ‘char*’, but argument 4 has type
‘diagnostics::paths::event_id_t* {aka diagnostic_event_id_t*}’ [-Wformat=]
../../gcc/gcc/analyzer/sm-malloc.cc:907:32: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc:912:48: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        m_actual_dealloc->m_name, &m_alloc_event);
                                                ^
../../gcc/gcc/analyzer/sm-malloc.cc:912:48: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::double_free::describe_final_event(pretty_printer&, const
ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:984:23: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
    &m_first_free_event);
                       ^
../../gcc/gcc/analyzer/sm-malloc.cc:984:23: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::possible_null_deref::describe_final_event(pretty_printer&,
const ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1069:32: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
    &m_origin_of_unchecked_event);
                                ^
../../gcc/gcc/analyzer/sm-malloc.cc:1069:32: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::possible_null_arg::describe_final_event(pretty_printer&,
const ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1167:32: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
    &m_origin_of_unchecked_event);
                                ^
../../gcc/gcc/analyzer/sm-malloc.cc:1167:32: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::use_after_free::describe_final_event(pretty_printer&, const
ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1379:42: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        funcname, ev.m_expr, &m_free_event);
                                          ^
../../gcc/gcc/analyzer/sm-malloc.cc:1379:42: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc:1384:42: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        funcname, ev.m_expr, &m_free_event);
                                          ^
../../gcc/gcc/analyzer/sm-malloc.cc:1384:42: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc:1390:42: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        funcname, ev.m_expr, &m_free_event);
                                          ^
../../gcc/gcc/analyzer/sm-malloc.cc:1390:42: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::malloc_leak::describe_final_event(pretty_printer&, const
ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1478:33: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        ev.m_expr, &m_alloc_event);
                                 ^
../../gcc/gcc/analyzer/sm-malloc.cc:1478:33: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc:1488:35: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
        "<unknown>", &m_alloc_event);
                                   ^
../../gcc/gcc/analyzer/sm-malloc.cc:1488:35: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/sm-malloc.cc: In member function ‘virtual bool
ana::{anonymous}::deref_before_check::describe_final_event(pretty_printer&,
const ana::evdesc::final_event&)’:
../../gcc/gcc/analyzer/sm-malloc.cc:1734:31: warning: unknown conversion type
character ‘@’ in format [-Wformat=]
    m_arg, &m_first_deref_event);
                               ^
../../gcc/gcc/analyzer/sm-malloc.cc:1734:31: warning: too many arguments for
format [-Wformat-extra-args]
../../gcc/gcc/analyzer/checker-event.cc: In member function ‘virtual void
ana::rewind_to_setjmp_event::print_desc(pretty_printer&) const’:
../../gcc/gcc/analyzer/checker-event.cc:1125:33: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
      &m_original_setjmp_event_id);
                                 ^
../../gcc/gcc/analyzer/checker-event.cc:1125:33: warning: too many arguments
for format [-Wformat-extra-args]
../../gcc/gcc/analyzer/checker-event.cc:1131:33: warning: unknown conversion
type character ‘@’ in format [-Wformat=]
      &m_original_setjmp_event_id);
                                 ^
../../gcc/gcc/analyzer/checker-event.cc:1131:33: warning: too many arguments
for format [-Wformat-extra-args]
make[2]: Leaving directory '/home/poulhies/git/gnat2fsf/build/gcc'
make[1]: *** [Makefile:4722: all-gcc] Error 2
make[1]: Leaving directory '/home/poulhies/git/gnat2fsf/build'
make: *** [Makefile:1064: all] Error 2
```

Reply via email to