#include "type_t.h"
#include "target_architecture.h"
#include "parser.h"
+#include "warning.h"
#include <assert.h>
#include <errno.h>
error_directive();
break;
case TP_pragma:
- warningf(lexer_token.source_position, "encountered unknown #pragma");
+ if (warning.unknown_pragmas) {
+ warningf(lexer_token.source_position, "encountered unknown #pragma");
+ }
eat_until_newline();
break;
}
OPT("redundant-decls", redundant_decls)
OPT("strict-prototypes", strict_prototypes)
OPT("switch-default", switch_default)
+ OPT("unknown-pragmas", unknown_pragmas)
#if 0
OPTX("unused") {
SET(unused_function)
.s_are_errors = false,
.strict_prototypes = true,
.switch_default = false,
+ .unknown_pragmas = true,
.unused_value = true
};
bool traditional:1; /* Warn about certain constructs that behave differently in traditional and ISO C */
bool undef:1; /* Warn if an undefined identifier is evaluated in an '#if' directive */
bool uninitialized:1; /* Warn if an automatic variable is used without being initialized or if a variable may be clobbered by a 'setjmp' call. */
- bool unknown_pragmas:1; /* Warn when a #pragma directive is encountered which is not understood by GCC */
+#endif
+ bool unknown_pragmas:1; /* Warn when a #pragma directive is encountered which is not understood */
+#if 0 // TODO
bool unreachable_code:1; /* Warn if the compiler detects that code will never be executed */
bool unused_function:1; /* Warn whenever a static function is declared but not defined or a non-inline static function is unused */
bool unused_label:1; /* Warn whenever a label is declared but not used */