使用 __block 时,clang BlocksRuntime 在可执行文件中嵌入 'obsolete compiler' 警告

clang BlocksRuntime embeds 'obsolete compiler' warning in executable when using __block

#include <stdio.h>
#include <Block.h>
int main()
{
  __block int x = 5;
  ^{printf("x is %i\n", x);}();
}

当我使用 clang 编译同时使用 clang 块和 __block 类型说明符的 c(或 c++)程序时,即使使用 -Wall 和 -Wpedantic,也不会产生编译器警告。该程序也按预期运行。但是,如果我使用文本编辑器打开可执行文件,我会发现这个文本块(使用 'strings' 命令提取):

Block_release called upon a stack Block: %p, ignored
_Block_byref_release: Block byref data structure at %p underflowed
Block compiled by obsolete compiler, please recompile source for this Block
descriptor->dispose helper: %p
byref data block %p contents:
^%p (new layout) =
isa?: %p
refcount: %u
invoke: %p
descriptor: %p
descriptor->reserved: %lu
descriptor->size: %lu
descriptor->copy helper: %p
  forwarding: %p
  flags: 0x%x
  size: %d
  copy helper: %p
  dispose helper: %p
NULL passed to _isa: stack Blockisa: malloc heapisa: GC heap Bloisa: global Blocisa: finalizing 

问题是我使用的是最新版本的 clang - 几乎不是 'obsolete' 编译器。我在 Linux (musl) 上,我从 https://github.com/mackyle/blocksruntime. I also found the piece of code that generates the warning here - https://github.com/mackyle/blocksruntime/blob/master/BlocksRuntime/runtime.c#L629

安装了 BlocksRuntime
λ: clang --version
clang version 10.0.0 
Target: x86_64-unknown-linux-musl
Thread model: posix
InstalledDir: /bin
λ: uname -a
Linux thinkpad 5.7.9_1 #1 SMP Thu Jul 16 10:02:50 UTC 2020 x86_64 GNU/Linux

忽略此警告是否安全?如果没有,我该怎么办?

我刚刚意识到这个警告可能是一个运行时错误,在可执行文件中存储为一个字符串,这意味着没有问题。反汇编似乎支持这个想法 - radare2 在 .rodata 部分显示字符串:

我真应该早点想到的...