[PATH] fix broken mac build on old clangs.

Dirk Hohndel dirk at hohndel.org
Sun Nov 8 22:57:03 PST 2015


> On Nov 8, 2015, at 10:41 PM, Thiago Macieira <thiago at macieira.org> wrote:
> 
> Can you try adding the -stdlib option in the AppleClang branch to see what 
> happens?

I have an odd question.

Why?

What we have in master works.

I have no interest in seeing Subsurface code made unreadable by C++11 features -
literally every thing I have seen so far from C++11 I find a) annoying b) not an
improvement.

Look at this:

diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 32f0d8d..b532b85 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -245,7 +245,7 @@ MainWindow::MainWindow() : QMainWindow(),
 
        if(PluginManager::instance().socialNetworkIntegrationPlugins().count()) {
                QMenu *connections = new QMenu(tr("Connect to"));
-               for(ISocialNetworkIntegration *plugin : PluginManager::instance().socialNetworkIntegrationPlugins()){
+               Q_FOREACH(ISocialNetworkIntegration *plugin, PluginManager::instance().socialNetworkIntegrationPlugins()){
                        QAction *toggle_connection = new QAction(this);
                        toggle_connection->setText(plugin->socialNetworkName());
                        toggle_connection->setIcon(QIcon(plugin->socialNetworkIcon()));
diff --git a/subsurface-core/pluginmanager.h b/subsurface-core/pluginmanager.h
index c494389..19e88b8 100644
--- a/subsurface-core/pluginmanager.h
+++ b/subsurface-core/pluginmanager.h
@@ -12,8 +12,8 @@ public:
        QList<ISocialNetworkIntegration*> socialNetworkIntegrationPlugins() const;
 private:
        PluginManager();
-       PluginManager(const PluginManager&) = delete;
-       PluginManager& operator=(const PluginManager&) = delete;
+       PluginManager(const PluginManager&){};
+       PluginManager& operator=(const PluginManager&){};
 };
 
 #endif

What is removed there to go back regular C++ is plain syntactic nonsense... 
the code that it brings back is actually readable and makes sense. So why would
I want to spend time to figure out how to allow C++11 code in Subsurface?

And don't get me started on the syntactic bullshit that is lambdas in C++. I can't
believe that I was tired enough to let that shit slip through in Tomaz' patches.

I know, Thiago, you are a C++ fan and deeply involved in C++11 and C++14.

I am interested in code that I can read and understand and maintain and that 
compiles on as many platforms as reasonable. Or to put this differently. Linus
and I allowed C++ into Subsurface because that allowed us to use a better
UI development environment. And for some things (strings, or some of the other
data structures like lists or hashes, for example), I see the value of using Qt 
over plain C. But many of the core developers here are not C++ people and I 
for one have no interest in going down that rat hole.

As Stroustroup says "C++11 feels like a new language". To add to that, it's closer
to Python than to C. Which I think sums up my feelings about it.

All that said? I think I'm happy with just rejecting C++11 code and keeping our
compilers focused on gnu99

/D

PS: yes, I'm old and grumpy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151108/e122f180/attachment-0001.html>


More information about the subsurface mailing list