-
Notifications
You must be signed in to change notification settings - Fork 273
/
Copy pathgcc_message_handler.h
51 lines (38 loc) · 1.18 KB
/
gcc_message_handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*******************************************************************\
Module:
Author: Daniel Kroening, [email protected]
\*******************************************************************/
#ifndef CPROVER_GOTO_CC_GCC_MESSAGE_HANDLER_H
#define CPROVER_GOTO_CC_GCC_MESSAGE_HANDLER_H
#include <util/cout_message.h>
class gcc_message_handlert : public console_message_handlert
{
public:
void print(unsigned, const xmlt &) override
{
}
void print(unsigned, const jsont &) override
{
}
// aims to imitate the messages gcc prints
void print(unsigned level, const std::string &message) override;
void print(
unsigned level,
const std::string &message,
const source_locationt &location) override;
/// With \p yes set to \c true, prefix warnings with "error:" instead of
/// "warning:".
/// \param yes: Whether or not to prefix warnings with "error:".
void print_warnings_as_errors(bool yes)
{
warnings_are_errors = yes;
}
private:
bool warnings_are_errors = false;
/// feed a command into a string
std::string string(const messaget::commandt &c) const
{
return command(c.command);
}
};
#endif // CPROVER_GOTO_CC_GCC_MESSAGE_HANDLER_H