[Libreoffice-commits] core.git: compilerplugins/clang vcl/unx
Stephan Bergmann
sbergman at redhat.com
Fri Nov 17 07:17:08 UTC 2017
compilerplugins/clang/casttovoid.cxx | 2 +-
vcl/unx/gtk/gtkdata.cxx | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
New commits:
commit 11b741ac5e32c65475c61961679adac11660eab2
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 17 08:09:59 2017 +0100
Make loplugin:casttovoid more resilient against macros
...in the type at the start of a ParmVarDecl, so that it does not erroneously
assume in isSharedCAndCppCode that the whole decl is in "the body of a macro
definition". (Even better might be to check the whole ParmVarDecl is inside one
macro body.)
Turns out that vcl/unx/gtk/gtkdata.cxx indirectly includes stdbool.h via some
vcl/inc/unx/saldisp.hxx -> workdir/UnpackedTarball/epoxy/include/epoxy/glx.h ->
workdir/UnpackedTarball/epoxy/include/epoxy/gl.h, and Clang's stdbool.h contains
> /* Don't define bool, true, and false in C++, except as a GNU extension. */
> #ifndef __cplusplus
> #define bool _Bool
> #define true 1
> #define false 0
> #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
> /* Define _Bool, bool, false, true as a GNU extension. */
> #define _Bool bool
> #define bool bool
> #define false false
> #define true true
> #endif
since <http://llvm.org/viewvc/llvm-project?view=revision&revision=115028>
"Define _Bool, bool, true, and false macros in <stdbool.h> when we're in a
GNU-compatible C++ dialect. Fixes <rdar://problem/8477819>" while GCC's
stdbool.h has meanwhile been improved with
<https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=216679> "C++11
explicitly forbids macros for bool, true and false" to
> #ifndef __cplusplus
>
> #define bool _Bool
> #define true 1
> #define false 0
>
> #else /* __cplusplus */
>
> /* Supporting _Bool in C++ is a GCC extension. */
> #define _Bool bool
>
> #if __cplusplus < 201103L
> /* Defining these macros in C++98 is a GCC extension. */
> #define bool bool
> #define false false
> #define true true
> #endif
>
> #endif /* __cplusplus */
Change-Id: I42caab83ac6e4d5e5297376136a6bbe6f3d70818
diff --git a/compilerplugins/clang/casttovoid.cxx b/compilerplugins/clang/casttovoid.cxx
index 1ed7e4e19c78..e98388c8de7b 100644
--- a/compilerplugins/clang/casttovoid.cxx
+++ b/compilerplugins/clang/casttovoid.cxx
@@ -414,7 +414,7 @@ private:
}
bool isSharedCAndCppCode(VarDecl const * decl) const {
- auto loc = decl->getLocStart();
+ auto loc = decl->getLocation();
while (compiler.getSourceManager().isMacroArgExpansion(loc)) {
loc = compiler.getSourceManager().getImmediateMacroCallerLoc(loc);
}
diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx
index c7eaa8da0039..c6f5925da80f 100644
--- a/vcl/unx/gtk/gtkdata.cxx
+++ b/vcl/unx/gtk/gtkdata.cxx
@@ -644,9 +644,8 @@ void GtkSalData::ErrorTrapPush()
gdk_error_trap_push ();
}
-bool GtkSalData::ErrorTrapPop( bool bIgnoreError )
+bool GtkSalData::ErrorTrapPop( bool )
{
- (void) bIgnoreError;
return gdk_error_trap_pop () != 0;
}
More information about the Libreoffice-commits
mailing list