Skip to content

Commit 7d5d927

Browse files
authored
Workaround gcc/newlib issue on Ubuntu 24 (#1863)
1 parent aa8cf17 commit 7d5d927

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

test/pico_float_test/pico_double_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#include <math.h>
1818
#include <pico/double.h>
1919
#include "pico/stdlib.h"
20+
// Include sys/types.h before inttypes.h to work around issue with
21+
// certain versions of GCC and newlib which causes omission of PRIx64
22+
#include <sys/types.h>
2023
#include "inttypes.h"
2124

2225
#define test_assert(x) ({ if (!(x)) { printf("Assertion failed: ");puts(#x);printf(" at " __FILE__ ":%d\n", __LINE__); exit(-1); } })

test/pico_float_test/pico_float_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#include <math.h>
1818
#include <pico/float.h>
1919
#include "pico/stdlib.h"
20+
// Include sys/types.h before inttypes.h to work around issue with
21+
// certain versions of GCC and newlib which causes omission of PRIx64
22+
#include <sys/types.h>
2023
#include "inttypes.h"
2124

2225
#define test_assert(x) ({ if (!(x)) { printf("Assertion failed: ");puts(#x);printf(" at " __FILE__ ":%d\n", __LINE__); exit(-1); } })

test/pico_sha256_test/pico_sha256_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
#include <stdio.h>
88
#include <string.h>
9+
// Include sys/types.h before inttypes.h to work around issue with
10+
// certain versions of GCC and newlib which causes omission of PRIu64
11+
#include <sys/types.h>
912
#include <inttypes.h>
1013
#include <stdlib.h>
1114

test/pico_stdlib_test/pico_stdlib_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66

77
#include <stdio.h>
8+
// Include sys/types.h before inttypes.h to work around issue with
9+
// certain versions of GCC and newlib which causes omission of PRIu64
10+
#include <sys/types.h>
811
#include <inttypes.h>
912
#include "pico/stdlib.h"
1013
#include "pico/bit_ops.h"

test/pico_time_test/pico_time_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include <hardware/sync.h>
1111
#include "pico/stdlib.h"
1212
#include "pico/test.h"
13+
// Include sys/types.h before inttypes.h to work around issue with
14+
// certain versions of GCC and newlib which causes omission of PRIi64
15+
#include <sys/types.h>
1316
#include <inttypes.h>
1417
PICOTEST_MODULE_NAME("pico_time_test", "pico_time test harness");
1518

0 commit comments

Comments
 (0)