diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-18 11:06:56 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-18 11:06:56 +0300 |
commit | c9ae9e148397f234d6d1dc1119800ddf3fc2e351 (patch) | |
tree | 5c553488df816f84700bba994d06c821935b738e /source/blender/blenlib | |
parent | df8a9648e2e349f9c673bf112285770cec6cb197 (diff) |
Cleanup: suppress dangling-pointer warning for GCC 12.1+
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/listbase.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index e2044955e48..3932e5eb051 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -193,9 +193,19 @@ void BLI_listbases_swaplinks(ListBase *listbasea, ListBase *listbaseb, void *vli return; } + /* The reference to `linkc` assigns NULL, not a dangling pointer so it can be ignored. */ +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 1201 /* gcc12.1+ only */ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdangling-pointer" +#endif + /* Temporary link to use as placeholder of the links positions */ BLI_insertlinkafter(listbasea, linka, &linkc); +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 1201 /* gcc12.1+ only */ +# pragma GCC diagnostic pop +#endif + /* Bring linka into linkb position */ BLI_remlink(listbasea, linka); BLI_insertlinkafter(listbaseb, linkb, linka); |