mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
-Wexport-undefined warning for exporting undefined symbols
This commit is contained in:
@@ -611,7 +611,7 @@ void sym_Export(std::string const &symName) {
|
||||
if (symName.starts_with('!')) {
|
||||
// LCOV_EXCL_START
|
||||
// The parser does not accept anonymous labels for an `EXPORT` directive
|
||||
error("Anonymous labels cannot be exported");
|
||||
error("Cannot export anonymous label");
|
||||
return;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
@@ -620,8 +620,10 @@ void sym_Export(std::string const &symName) {
|
||||
|
||||
// If the symbol doesn't exist, create a ref that can be purged
|
||||
if (!sym) {
|
||||
warning(WARNING_EXPORT_UNDEFINED, "Exporting an undefined symbol `%s`", symName.c_str());
|
||||
sym = sym_Ref(symName);
|
||||
}
|
||||
|
||||
sym->isExported = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
|
||||
{"empty-data-directive", LEVEL_ALL },
|
||||
{"empty-macro-arg", LEVEL_EXTRA },
|
||||
{"empty-strrpl", LEVEL_ALL },
|
||||
{"export-undefined", LEVEL_ALL },
|
||||
{"large-constant", LEVEL_DEFAULT },
|
||||
{"macro-shift", LEVEL_EXTRA },
|
||||
{"nested-comment", LEVEL_DEFAULT },
|
||||
|
||||
Reference in New Issue
Block a user