Make compile on amd64 and friends
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 20 Sep 2008 08:27:13 +0000 (10:27 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 20 Sep 2008 08:27:13 +0000 (10:27 +0200)
CMakeLists.txt
src/common/quassel.h
src/uisupport/actioncollection.cpp

index 650720a..c824609 100644 (file)
@@ -49,19 +49,8 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
 
 # Enable various flags on gcc
 if(CMAKE_COMPILER_IS_GNUCXX)
-  include(CheckCXXCompilerFlag)
-  check_cxx_compiler_flag(-Wall HAVE_WALL)
-  if(HAVE_WALL)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-  endif(HAVE_WALL)
-  check_cxx_compiler_flag(-Wextra HAVE_WEXTRA)
-  if(HAVE_WEXTRA)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
-  endif(HAVE_WEXTRA)
-  check_cxx_compiler_flag(-ansi HAVE_ANSI)
-  if(HAVE_ANSI)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi")
-  endif(HAVE_ANSI)
+  # Let's just hope that all gccs support these options and skip the tests...
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi -Wall -Wextra -Wnon-virtual-dtor")
 endif(CMAKE_COMPILER_IS_GNUCXX)
 
 set(QT_MIN_VERSION "4.4.0")
index 71c19b8..40e2e12 100644 (file)
@@ -55,7 +55,7 @@ class Quassel {
       QString organizationDomain;
     };
 
-    ~Quassel();
+    virtual ~Quassel();
 
     static inline const BuildInfo & buildInfo();
     static inline RunMode runMode();
index 8a5d606..9175ecc 100644 (file)
@@ -51,6 +51,7 @@ QList<QAction *> ActionCollection::actions() const {
 
 Action *ActionCollection::addAction(const QString &name, Action *action) {
   QAction *act = addAction(name, static_cast<QAction *>(action));
+  Q_UNUSED(act);
   Q_ASSERT(act == action);
   return action;
 }
@@ -74,7 +75,7 @@ QAction *ActionCollection::addAction(const QString &name, QAction *action) {
   else
     action->setObjectName(indexName);
   if(indexName.isEmpty())
-    indexName = QString("unnamed-%1").arg((int)action, 16);
+    indexName = indexName.sprintf("unnamed-%p", (void *)action);
 
   // do we already have this action?
   if(_actionByName.value(indexName, 0) == action)