Opened at 2013-09-20T23:06:59Z
Last modified at 2026-10-02T00:49:14Z
#928 accepted meta
adapt codebase to Clang
| Reported by: | Ichthyostega | Owned by: | Ichthyostega |
|---|---|---|---|
| Priority: | lesser | Milestone: | |
| Component: | lumiera | Keywords: | QA platform ongoing |
| Sub Tickets: | #934, #947 | Parent Tickets: | #932, #964 |
Description (last modified by )
Clang is a well-designed modern compiler based on the LLVM compiler framework. It can be used as a drop-in replacement for GCC and is known to produce way more consistent and readable error messages. We want to support compilation with both Clang and GCC as a means to ensure good conformance to language standards, and to avoid accruing unintended technical dept.
Clang generates additional warnings and diagnostics, which should be resolved.
The purpose of this ticket is to remind and track progress for this ongoing and sometimes tedious task
Change history (12)
comment:1 by , at 2013-09-23T00:29:23Z
| blocking: | 924 → 924, 932 |
|---|
comment:3 by , at 2013-10-12T22:48:30Z
| blockedby: | → 934 |
|---|
comment:4 by , at 2013-10-21T03:23:45Z
After a bunch of bug-fixes, we're now able to compile with Clang, and the test-suite runs without failure.
Lots of further warnings remain to be resolved though
comment:5 by , at 2014-09-13T00:54:06Z
| Owner: | set to |
|---|---|
| Status: | new → accepted |
| Type: | todo → planned |
put this *on hold*.
Our reference system is Debian-Wheezy; but CLang 3.0 is just not up to the job. After the C++11 transition, it segfaults when complining some inline lambdas.
We should consider to raise the minimum version level of CLang to 3.4 and we should consider to upgrad the reference system to Debian-testing (Jessie)
comment:6 by , at 2014-09-13T01:37:10Z
| blockedby: | 934 → 934, 947 |
|---|
comment:7 by , at 2014-09-13T01:43:26Z
| blocking: | 924, 932 → 932 |
|---|
comment:8 by , at 2014-09-24T00:58:07Z
further initialisation problems when running the testsuite, compiled with Clang 3.4 on Debian-Jessie.
- problem looks quite similar to initialisation issues I've fixed one year ago, in f136220131
- we're about to init a static object field (typically templated). This field uses a _Fmt object, which lives in a local (anonymous namespace) variable in the enclosing scope
- seems like GCC initialised all local variables in a given compilation unit from top to bottom, while Clang first initialises all static fields, and later the local variables in a second pass.
- consequently the static initialisation uses a not-yet constructed _Fmt object, which leads to all kinds of segfaults and weird behaviour.
These usage situations happen to be in unit test code only, since such a usage is also not thread safe and not re-entrant (the boost::format implementation is stateful). While in theory this could be fixed by always using a Meyers singleton, in such cases the simplest fix is just to construct a new formatter object on each call....
comment:9 by , at 2015-11-20T05:05:04Z
currently, we can build with Clang 3.5, but still get a lot of additional warnings
comment:10 by , at 2025-12-25T00:00:00Z
| blockedby: | 934, 947 |
|---|---|
| blocking: | 932 |
| Parent Tickets: | → 932 |
| Sub Tickets: | → 934, 947 |
Migration MasterTickets ⟼ Subtickets-plugin
comment:11 by , at 2026-10-01T03:11:55Z
| Description: | modified (diff) |
|---|---|
| Keywords: | platform ongoing added |
| Parent Tickets: | 932 → 932, 964 |
| Type: | planned → meta |
This is established practice in the Lumiera project. With #1436 our buildsystem supports generation of a compilation database, so that clangd can be used for code-intelligence and diagnostics.
