Skip to content

Commit 01edbb8

Browse files
author
Ben Avison
committed
IAR doesn't support __attribute__((fallthrough))
IAR generates warning Pa167 'the "fallthrough" attribute is not supported'. It doesn't generate warnings when one switch case falls through to another, so simply make TU_ATTR_FALLTHROUGH expand to an empty string. Also replace one instance of __attribute__ with the macro.
1 parent 62d90c8 commit 01edbb8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/common/tusb_compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
#define TU_ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
190190
#define TU_ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
191191
#define TU_ATTR_USED __attribute__ ((used)) // Function/Variable is meant to be used
192-
#define TU_ATTR_FALLTHROUGH __attribute__((fallthrough))
192+
#define TU_ATTR_FALLTHROUGH
193193

194194
#define TU_ATTR_PACKED_BEGIN
195195
#define TU_ATTR_PACKED_END

src/host/usbh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ static void process_enumeration(tuh_xfer_t* xfer)
12731273
break;
12741274
}
12751275
#endif
1276-
__attribute__((fallthrough));
1276+
TU_ATTR_FALLTHROUGH;
12771277
#endif
12781278

12791279
case ENUM_SET_ADDR:

0 commit comments

Comments
 (0)