Attempt to deconfuse the coverage analyzer.
This commit is contained in:
parent
fd02259c7f
commit
83ff9d0c0e
3 changed files with 14 additions and 6 deletions
8
common.h
8
common.h
|
@ -35,12 +35,8 @@ enum bugtype {
|
||||||
ACTION_RETURNED_PHASE_CODE_BEYOND_END_OF_SWITCH, // 100
|
ACTION_RETURNED_PHASE_CODE_BEYOND_END_OF_SWITCH, // 100
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void bug(enum bugtype num, const char *error_string) __attribute__((__noreturn__));
|
/* Alas, declaring this static confuses the coverage analyzer */
|
||||||
static inline void bug(enum bugtype num, const char *error_string)
|
void bug(enum bugtype, const char *) __attribute__((__noreturn__));
|
||||||
{
|
|
||||||
fprintf(stderr, "Fatal error %d, %s.\n", num, error_string);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define BUG(x) bug(x, #x)
|
#define BUG(x) bug(x, #x)
|
||||||
|
|
||||||
|
|
|
@ -554,6 +554,12 @@ static void write_file(FILE* header_file)
|
||||||
fprintf(header_file, "#endif\n");
|
fprintf(header_file, "#endif\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bug(enum bugtype num, const char *error_string)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Fatal error %d, %s.\n", num, error_string);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
FILE* database = fopen("adventure.text", "r");
|
FILE* database = fopen("adventure.text", "r");
|
||||||
|
|
6
misc.c
6
misc.c
|
@ -658,4 +658,10 @@ void DATIME(long* d, long* t)
|
||||||
*t = (long) tv.tv_usec;
|
*t = (long) tv.tv_usec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bug(enum bugtype num, const char *error_string)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Fatal error %d, %s.\n", num, error_string);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
/* end */
|
/* end */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue