CBMC
gcc_message_handler.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 #ifndef CPROVER_GOTO_CC_GCC_MESSAGE_HANDLER_H
10 #define CPROVER_GOTO_CC_GCC_MESSAGE_HANDLER_H
11 
12 #include <util/cout_message.h>
13 
15 {
16 public:
17  void print(unsigned, const xmlt &) override
18  {
19  }
20 
21  void print(unsigned, const jsont &) override
22  {
23  }
24 
25  // aims to imitate the messages gcc prints
26  void print(unsigned level, const std::string &message) override;
27 
28  void print(
29  unsigned level,
30  const std::string &message,
31  const source_locationt &location) override;
32 
36  void print_warnings_as_errors(bool yes)
37  {
38  warnings_are_errors = yes;
39  }
40 
41 private:
42  bool warnings_are_errors = false;
43 
45  std::string string(const messaget::commandt &c) const
46  {
47  return command(c.command);
48  }
49 };
50 
51 #endif // CPROVER_GOTO_CC_GCC_MESSAGE_HANDLER_H
std::string command(unsigned c) const override
Create an ECMA-48 SGR (Select Graphic Rendition) command with given code.
void print_warnings_as_errors(bool yes)
With yes set to true, prefix warnings with "error:" instead of "warning:".
void print(unsigned, const jsont &) override
std::string string(const messaget::commandt &c) const
feed a command into a string
void print(unsigned, const xmlt &) override
Definition: json.h:27
unsigned command
Definition: message.h:323
Definition: xml.h:21