Skip to content

Commit 7df8dd6

Browse files
committed
Bugfix: grpc supress incorrect warning
new_p is a local addr but is owned now by slice_ thus the life time does not end at the end of the function
1 parent 5218e29 commit 7df8dd6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/flatbuffers/grpc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ class SliceAllocator : public Allocator {
121121
memcpy_downward(old_p, old_size, new_p, new_size, in_use_back,
122122
in_use_front);
123123
slice_ = new_slice;
124+
#pragma GCC diagnostic push
125+
#pragma GCC diagnostic ignored "-Wreturn-local-addr"
124126
return new_p;
127+
#pragma GCC diagnostic pop
125128
}
126129

127130
private:

0 commit comments

Comments
 (0)