Skip to content

Commit deaa46a

Browse files
aykevldpgeorge
authored andcommitted
py/nlrthumb: Fix Clang support wrt use of "return 0".
Clang defines __GNUC__ so we have to check for it specifically.
1 parent 527ba04 commit deaa46a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

py/nlrthumb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ __attribute__((naked)) unsigned int nlr_push(nlr_buf_t *nlr) {
7676
#endif
7777
);
7878

79-
#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))
79+
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))
8080
// Older versions of gcc give an error when naked functions don't return a value
81+
// Additionally exclude Clang as it also defines __GNUC__ but doesn't need this statement
8182
return 0;
8283
#endif
8384
}

0 commit comments

Comments
 (0)