File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 22
22
namespace {
23
23
USING_NEXTPNR_NAMESPACE;
24
24
25
+ // `memcpy` is used here to avoid strict-aliasing problems, but GCC dislikes it.
26
+ #pragma GCC diagnostic push
27
+ #pragma GCC diagnostic ignored "-Wclass-memaccess"
25
28
template <typename T>
26
29
uint64_t wrap (T thing) {
27
30
static_assert (sizeof (T) <= 8 , " T is too big for FFI" );
@@ -50,6 +53,7 @@ namespace {
50
53
memcpy (&w, &wire, sizeof (WireId));
51
54
return w;
52
55
}
56
+ #pragma GCC diagnostic pop
53
57
}
54
58
55
59
using DownhillIter = decltype(Context(ArchArgs()).getPipsDownhill(WireId()).begin());
@@ -99,8 +103,10 @@ extern "C" {
99
103
100
104
uint64_t npnr_context_get_pips_leak (const Context *ctx, uint64_t **pips) {
101
105
auto size = size_t {};
102
- for (auto _pip : ctx->getPips ())
106
+ for (auto _pip : ctx->getPips ()) {
107
+ NPNR_UNUSED (_pip);
103
108
size++;
109
+ }
104
110
*pips = new uint64_t [size];
105
111
auto idx = 0 ;
106
112
for (auto pip : ctx->getPips ()) {
@@ -113,8 +119,10 @@ extern "C" {
113
119
114
120
uint64_t npnr_context_get_wires_leak (const Context *ctx, uint64_t **wires) {
115
121
auto size = size_t {};
116
- for (auto _wire : ctx->getWires ())
122
+ for (auto _wire : ctx->getWires ()) {
123
+ NPNR_UNUSED (_wire);
117
124
size++;
125
+ }
118
126
*wires = new uint64_t [size];
119
127
auto idx = 0 ;
120
128
for (auto wire : ctx->getWires ()) {
You can’t perform that action at this time.
0 commit comments