2019-03-24 09:09:12 +00:00
|
|
|
/*
|
|
|
|
* error.h
|
|
|
|
*
|
|
|
|
* Created on: 2018-11-17
|
|
|
|
* Author: carl
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __ERROR_H_INCLUDED__
|
|
|
|
#define __ERROR_H_INCLUDED__
|
|
|
|
|
|
|
|
void stop(void);
|
|
|
|
void fatal(char *format, ...);
|
|
|
|
void warning(char *format, ...);
|
|
|
|
void error(char *format, ...);
|
Reduce warnings, adjust format strings in util/led
Calls like `debug("something\n", 0, 0, 0, 0)` cause clang warnings,
because debug() is a macro that passes its arguments to printf(), and
clang warns about extra 0s to printf(). Silence the warnings by
hiding the printf() in a new function do_debug(). The code still
passes extra 0s to printf(), but clang can't warn.
Macros debug() and verbose() should use C99 __VA_ARGS__, so they don't
require the extra 0s; but ACK doesn't use __VA_ARGS__ yet.
Adjust some format strings for debug() or fatal(), or cast their
arguments, to match their types. I don't know whether uint32_t is
unsigned int or unsigned long, so I cast it to unsigned long, and
print it with "%lx".
In util/led/sym.c, #include "save.h" to declare savechar(), and use
parentheses to silence a clang warning in hash().
2019-11-01 22:27:34 +00:00
|
|
|
int do_debug(char *format, ...);
|
2019-03-24 09:09:12 +00:00
|
|
|
int do_verbose(char *format, ...);
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __ERROR_H_INCLUDED__ */
|