If your C code can also be compiled in C++ mode, you can use g++'s -Wold-style-cast
warning flag to trigger a warning on all such casts.
You can determine whether Clang has any warnings which will trigger for a particular coding pattern by using its -Weverything
switch (but note that this is not useful for almost any other purpose -- clang has disabled-by-default warnings which trigger on various forms of legitimate code). However, in this case, clang does not have any warnings which trigger on such casts.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…