Skip to content

Commit

Permalink
Make Newlib use int for INT32 PRx types
Browse files Browse the repository at this point in the history
Otherwise GCC will default to using `long` which can cause format strings
to fail due to int/long mismatch.
  • Loading branch information
earlephilhower committed Jul 17, 2021
1 parent 9bcba0b commit 1757bed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/gcc10.3/gcc-int32-is-int.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 8e1bcf823e4..3cfcd2b6628 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -801,3 +801,8 @@ typedef struct xtensa_args
callx0\ta0\n" \
TEXT_SECTION_ASM_OP);
#endif
+
+
+/* Use int, instead of long int, for int32_t and uint32_t. */
+#undef STDINT_LONG32
+#define STDINT_LONG32 0

0 comments on commit 1757bed

Please sign in to comment.