[cfe-dev] [libc++abi] [PATCH] silencing -Wundef warnings
Nick Kledzik
kledzik at apple.com
Mon Oct 28 14:45:57 PDT 2013
-#if __arm__
+#if defined(__arm__)
The above is a semantic change. If someone set -D__arm__=0, the changed code does something different.
IANALL, but -Wundef triggering on these built-in preprocessor symbols seems wrong.
-Nick
On Oct 28, 2013, at 11:03 AM, Florian Kutscherauer <florian.kutscherauer at gmx.at> wrote:
> Good Evening to you all,
>
>
> I tried to compile libc++abi with -Weverything enabled and got a whole
> bunch of warnings.
>
> I changed some #if X's to #if defined(X)'s to silence all of the -Wundef
> warnings.
>
> None of the functionality has changed, so it should be safe to apply the
> the attached patch without breaking anything. *fingers crossed*
>
> Also, there are some unused (member-)functions in cxa_demangle.cpp,
> cxa_guard.cpp, and stdexcept.cpp. Are those intentionally kept, or are
> they "leftovers" and could be removed?
>
> I hope this is useful to someone. I will keep working on some of the
> other warnings (a whole bunch of them are caused by casting pointers
> with different alignment-requirements) and refactoring the code a bit.
> Unless someone wants me to "keep my filthy hands off" their code, that
> is. ;-)
>
>
> Best regards, Flo.
>
>
> ---
> include/cxxabi.h | 2 +-
> include/unwind.h | 10 +++++-----
> src/abort_message.cpp | 6 +++---
> src/cxa_exception.cpp | 6 +++---
> src/cxa_exception.hpp | 8 ++++----
> src/cxa_guard.cpp | 3 ++-
> src/cxa_personality.cpp | 14 +++++++-------
> src/private_typeinfo.cpp | 8 ++++----
> src/stdexcept.cpp | 12 ++++++------
> 9 files changed, 35 insertions(+), 34 deletions(-)
> <fix-Wundef.patch>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list