Skip to content

Commit

Permalink
Fix compile on gcc12
Browse files Browse the repository at this point in the history
  • Loading branch information
Coldwings committed Jun 18, 2024
1 parent b69e785 commit 366cb42
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion common/iovector.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ limitations under the License.
#include <photon/common/io-alloc.h>

#pragma GCC diagnostic push
#if __GNUC__ >= 13
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#endif
#if __GNUC__ >= 12
#pragma GCC diagnostic ignored "-Wzero-length-bounds"
#endif

Expand Down
2 changes: 1 addition & 1 deletion common/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ TEST(Callback, virtual_function)
// Callback<int> ee([&](int x){ return RET + x/2; });

#pragma GCC diagnostic push
#if __GNUC__ >= 13
#if __GNUC__ >= 12
#pragma GCC diagnostic ignored "-Wdangling-pointer"
#endif
THIS = (BB*)&c;
Expand Down
4 changes: 3 additions & 1 deletion rpc/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,10 @@ namespace rpc {
return -1;

#pragma GCC diagnostic push
#if __GNUC__ >= 13
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#endif
#if __GNUC__ >= 12
#pragma GCC diagnostic ignored "-Wdangling-pointer"
#endif
ThreadLink node;
Expand Down

0 comments on commit 366cb42

Please sign in to comment.