Skip to content

Commit d435d66

Browse files
committed
fix: Fix build errors on GCC15
1 parent 30c7349 commit d435d66

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ endif
393393
CFLAGS += -DDFU_APP_DATA_RESERVED=$(DFU_APP_DATA_RESERVED)
394394

395395
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
396-
# Fixes for gcc version 12, 13 and 14.
397-
ifneq (,$(filter 12.% 13.% 14.%,$(shell $(CC) -dumpversion 2>$(NULL_DEVICE))))
396+
# Fixes for gcc version 12, 13, 14 and 15.
397+
ifneq (,$(filter 12.% 13.% 14.% 15.%,$(shell $(CC) -dumpversion 2>$(NULL_DEVICE))))
398398
CFLAGS += --param=min-pagesize=0
399399
endif
400400

src/usb/uf2/ghostfat.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@
4040
//
4141
//--------------------------------------------------------------------+
4242

43+
// Add nonstring attribute if supported to avoid errors in GCC 15
44+
#ifdef __has_attribute
45+
#define __NONSTRING__ __attribute__((nonstring))
46+
#else
47+
#define __NONSTRING__
48+
#endif
49+
4350
typedef struct {
4451
uint8_t JumpInstruction[3];
45-
uint8_t OEMInfo[8];
52+
uint8_t OEMInfo[8] __NONSTRING__;
4653
uint16_t SectorSize;
4754
uint8_t SectorsPerCluster;
4855
uint16_t ReservedSectors;
@@ -59,8 +66,8 @@ typedef struct {
5966
uint8_t Reserved;
6067
uint8_t ExtendedBootSig;
6168
uint32_t VolumeSerialNumber;
62-
uint8_t VolumeLabel[11];
63-
uint8_t FilesystemIdentifier[8];
69+
uint8_t VolumeLabel[11] __NONSTRING__;
70+
uint8_t FilesystemIdentifier[8] __NONSTRING__;
6471
} __attribute__((packed)) FAT_BootBlock;
6572

6673
typedef struct {
@@ -81,7 +88,7 @@ typedef struct {
8188
STATIC_ASSERT(sizeof(DirEntry) == 32);
8289

8390
struct TextFile {
84-
char const name[11];
91+
char const name[11] __NONSTRING__;
8592
char const *content;
8693
};
8794

0 commit comments

Comments
 (0)