#include #include int mcpp_diagnostic_warning( const mcpp_options *options, const char *filename, unsigned line_number, const char *format, ... ) { va_list ap; int as_error; if( options != NULL && options->inhibit_warnings ) return( 0 ); as_error = options != NULL && options->warnings_are_errors; fprintf( stderr, "%s:%u: %s: ", filename != NULL ? filename : "", line_number, as_error ? "error" : "warning" ); va_start( ap, format ); vfprintf( stderr, format, ap ); va_end( ap ); fputc( '\n', stderr ); return( as_error ? -1 : 0 ); }