summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-11-17 08:09:59 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-11-17 08:16:47 +0100
commit11b741ac5e32c65475c61961679adac11660eab2 (patch)
treebfbadfc306fc56065c08decba934f7144660ad1d /vcl/unx/gtk
parent56379beb1ea55c1262382039aba2dbb335e92b67 (diff)
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
Diffstat (limited to 'vcl/unx/gtk')
-rw-r--r--vcl/unx/gtk/gtkdata.cxx3
1 files changed, 1 insertions, 2 deletions
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;
}