Doxygen: C++11 features used in Doxygen

Created on 17 Sep 2018  路  7Comments  路  Source: doxygen/doxygen

The CGAL project builds doxygen master branch every night, to do a regression test against previous versions. From

In file included from (...)/doxygen_master/src/doxygen.cpp:65:0:
(...)/doxygen_master/src/docbookgen.h:353:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     bool m_prettyCode = FALSE;
                         ^
(...)/doxygen_master/src/docbookgen.h:354:24: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     bool m_denseText = FALSE;
                        ^
(...)/doxygen_master/src/docbookgen.h:355:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     bool m_inGroup = FALSE;
                      ^
(...)/doxygen_master/src/docbookgen.h:356:23: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     bool m_inDetail = FALSE;
                       ^
(...)/doxygen_master/src/docbookgen.h:357:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     int  m_levelListItem = 0;
                            ^
(...)/doxygen_master/src/docbookgen.h:360:24: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     bool m_descTable = FALSE;
                        ^
(...)/doxygen_master/src/docbookgen.h:361:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     int m_inLevel = -1;
                      ^
(...)/doxygen_master/src/docbookgen.h:362:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     bool m_firstMember = FALSE;
                          ^

Since #6487 has been merged, there are warnings about use of C++11 features, unconditionally. Is that a new requirement of Doxygen, that the compiler has to support C++11? The installation documentation of Doxygen does not say anything about the compiler, but that change is a regression. In C++ before 11, the non-static member variables must initialized in the constructor.

@doxygen Do you want to document that C++11 is required, or shall I prepare a pull-request to revert to C++03?

bug instalbuild

All 7 comments

I've just pushed a proposed patch, including some corrections about problems as reported by Travis CI as well, pull request #6520

I have a question about this: what's the issue of requiring C++11? Doxygen is a tool and run as a binary, C++11 is already 7 year old and C++17 was already released. Isn't it a good thing to evolve the code with new standard?

When programming for multiple platforms one has to be a bit conservative in the used versions as not all platforms (and users) are up to date with compilers, runtime environments etc. so one should not require the newest compilers / supported standard for generating the binaries.

@jgzhuang commented on Sep 17, 2018, 11:32 PM GMT+2:

I have a question about this: what's the issue of requiring C++11? Doxygen is a tool and run as a binary, C++11 is already 7 year old and C++17 was already released. Isn't it a good thing to evolve the code with new standard?

Personally, I do not mind, but it should be documented, and correctly advertised in the release notes.

I have a question about this: what's the issue of requiring C++11? Doxygen is a tool and run as a binary, C++11 is already 7 year old and C++17 was already released. Isn't it a good thing to evolve the code with new standard?

I started with doxygen already in 1997, so more than 14 years before there was a C++11 standard (let alone proper compiler support). I have used a subset of the tools part of Qt as a replacement for STL. Of course nowadays it has become possible to move to a new C++ standard, but STL and Qt don't mix that well conceptually so it would not directly result in better code.

I agree it is good to mention some coding conventions and restrictions somewhere.

I totally understand why doxygen initially used C++98. But nowadays this is not state-of-the-art anymore. Grepping through the code I find:

$ grep -P "new|delete" *.cpp | wc -l
2322

And most of these can be removed in favour of smart pointers, thus making memory leaks much less probable.

And move constructors would fix a lot of hacky performance enhancements (pass-by-non-const-ref for speed only) and create much nicer code.

Don't get me wrong. I use doxygen on all of my projects (also for unsupported languages with filters) and it definitly is the standard solution. But the codebase is pretty dusty (and wildwest wrt to formatting) thus at least stopping me twice of getting something fixed.

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.8.15.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

Was this page helpful?
0 / 5 - 0 ratings