anchor.diff:                        records -> [];
                         maps    -> [?expr(MsgName)]
                     end,
  -    gpb_codegen:format_fn(
  -      verify_msg,
  -      fun(Msg, '<MsgName>') ->
  -              case '<MsgOrMsgName>' of
  -                  '<msg-match>' -> '<verify-msg>'(Msg, ['<MsgName>']);
  -                  _ -> mk_type_error(not_a_known_message, Msg, [])
  -              end
  -      end,
  -      [repeat_clauses(
  -         '<msg-match>',
  -         [[replace_tree('<msg-match>',
  -                        case Mapping of
  -                            records -> record_match(MsgName, []);
  -                            maps    -> erl_syntax:atom(MsgName)
  -                        end),
  -           replace_term('<verify-msg>', mk_fn(v_msg_, MsgName)),
  -           replace_term('<MsgName>', MsgName)]
  -          || {{msg, MsgName}, _MsgDef} <- Defs]),
  -       replace_tree('<MsgOrMsgName>', case Mapping of
  -                                          records -> ?expr(Msg);
  -                                          maps    -> ?expr(MsgName)
  -                                      end),
  -       splice_trees('<MsgName>', MsgNameVars)]).
  +    SpecExtraArgs = case Mapping of
  +                        records -> "";
  +                        maps    -> ",_"
  +                    end,
  +    [case contains_messages(Defs) of
  +         true  -> "";
  +         false -> ?f("-spec verify_msg(_~s) -> no_return().~n", [SpecExtraArgs])
  +     end,
  +     gpb_codegen:format_fn(
  +       verify_msg,
  +       fun(Msg, '<MsgName>') ->
  +               case '<MsgOrMsgName>' of
  +                   '<msg-match>' -> '<verify-msg>'(Msg, ['<MsgName>']);
  +                   _ -> mk_type_error(not_a_known_message, Msg, [])
  +               end
  +       end,
  +       [repeat_clauses(
  +          '<msg-match>',
  +          [[replace_tree('<msg-match>',
  +                         case Mapping of
  +                             records -> record_match(MsgName, []);
  +                             maps    -> erl_syntax:atom(MsgName)
  +                         end),
  +            replace_term('<verify-msg>', mk_fn(v_msg_, MsgName)),
  +            replace_term('<MsgName>', MsgName)]
  +           || {{msg, MsgName}, _MsgDef} <- Defs]),
  +        replace_tree('<MsgOrMsgName>', case Mapping of
  +                                           records -> ?expr(Msg);
  +                                           maps    -> ?expr(MsgName)
  +                                       end),
  +        splice_trees('<MsgName>', MsgNameVars)])].
   
   format_verifiers(Defs, AnRes, Opts) ->
       [format_msg_verifiers(Defs, AnRes, Opts),
        format_enum_verifiers(Defs, AnRes),
        format_type_verifiers(AnRes),
        format_map_verifiers(AnRes, Opts),
  -     format_verifier_auxiliaries()
  +     format_verifier_auxiliaries(Defs)
       ].
   
   format_msg_verifiers(Defs, AnRes, Opts) ->
  
positive.code:                replace_term('VerifyValue', ValueVerifierFn)])
      end.
  
  format_verifier_auxiliaries() ->
      [gpb_codegen:format_fn(
         mk_type_error,
         fun(Error, ValueSeen, Path) ->
                 Path2 = prettify_path(Path),
  
negative.code: format_msg_merge_code_no_msgs(Opts) ->
      case get_records_or_maps_by_opts(Opts) of
          records ->
              ["-spec merge_msgs(_, _) -> no_return().\n",
               gpb_codegen:format_fn(
                 merge_msgs,
                 fun(_Prev, _New) ->
                         erlang:error({gpb_error, no_messages})
                 end)];
          maps ->
              ["-spec merge_msgs(_, _, _) -> no_return().\n",
               gpb_codegen:format_fn(
                 merge_msgs,
                 fun(_Prev, _New, _MsgName) ->
                         erlang:error({gpb_error, no_messages})
                 end)]
      end.
  
  format_msg_merge_code_msgs(Defs, AnRes, Opts) ->
  