Use standard attribute syntax instead of IBM __attribute__

Move format attrs to proper standard location

For some reason, GCC 13 is more lax than earlier versions...
This commit is contained in:
ISSOtm
2024-03-28 00:47:58 +01:00
committed by Rangi42
parent 506911d7d0
commit cae7b5dcf6
11 changed files with 36 additions and 42 deletions

View File

@@ -47,7 +47,7 @@ std::optional<std::string> currentLoadScope = std::nullopt;
int32_t loadOffset; // Offset into the LOAD section's parent (see sect_GetOutputOffset)
// A quick check to see if we have an initialized section
attr_(warn_unused_result) static bool checksection() {
[[nodiscard]] static bool checksection() {
if (currentSection)
return true;
@@ -57,7 +57,7 @@ attr_(warn_unused_result) static bool checksection() {
// A quick check to see if we have an initialized section that can contain
// this much initialized data
attr_(warn_unused_result) static bool checkcodesection() {
[[nodiscard]] static bool checkcodesection() {
if (!checksection())
return false;
@@ -71,7 +71,7 @@ attr_(warn_unused_result) static bool checkcodesection() {
return false;
}
attr_(warn_unused_result) static bool checkSectionSize(Section const &sect, uint32_t size) {
[[nodiscard]] static bool checkSectionSize(Section const &sect, uint32_t size) {
uint32_t maxSize = sectionTypeInfo[sect.type].size;
// If the new size is reasonable, keep going
@@ -88,7 +88,7 @@ attr_(warn_unused_result) static bool checkSectionSize(Section const &sect, uint
}
// Check if the section has grown too much.
attr_(warn_unused_result) static bool reserveSpace(uint32_t delta_size) {
[[nodiscard]] static bool reserveSpace(uint32_t delta_size) {
// This check is here to trap broken code that generates sections that are too big and to
// prevent the assembler from generating huge object files or trying to allocate too much
// memory.