building Audacity 2.0.6 with Clang 3.5

Asked by RJVB

How does one build Audacity 2.0.6 with clang (3.5) on Linux? Using this compiler works without a glitch on OS X (also against wxGTk, but v2.8), even without the ftbs clang patch in debian/patches .
So I thought that creating a PPA that uses clang would be as simple as adding clang-3.5 to the build dependencies in debian/control, and doing

export CC=clang-3.5
export CXX=clang++-3.5

in debian/rules

However, this leads to configure or build errors, see e.g. https://launchpad.net/~rjvbertin/+archive/ubuntu/misc/+build/7089397/+files/buildlog_ubuntu-trusty-amd64.audacity_2.0.6-2-rjvb-ppa20150319c_BUILDING.txt.gz

Has building with clang against wxGTk-3.0 been tested?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu audacity Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

It seems that clang is rating a certain coding inconsistency as error, but is just a warning in g++

https://launchpadlibrarian.net/188319603/buildlog_ubuntu-vivid-amd64.audacity_2.0.6-2_UPLOADING.txt.gz

import/ImportFLAC.cpp: In member function 'virtual ImportFileHandle* FLACImportPlugin::Open(wxString)':
import/ImportFLAC.cpp:299:14: warning: converting 'false' to pointer type 'ImportFileHandle*' [-Wconversion-null]
       return false; // File not found
              ^
import/ImportFLAC.cpp:316:14: warning: converting 'false' to pointer type 'ImportFileHandle*' [-Wconversion-null]
       return false;
              ^

versus

https://launchpad.net/~rjvbertin/+archive/ubuntu/misc/+build/7089397/+files/buildlog_ubuntu-trusty-amd64.audacity_2.0.6-2-rjvb-ppa20150319c_BUILDING.txt.gz

import/ImportFLAC.cpp:299:14: error: cannot initialize return object of type 'ImportFileHandle *' with an rvalue of type 'bool'
      return false; // File not found
             ^~~~~
import/ImportFLAC.cpp:316:14: error: cannot initialize return object of type 'ImportFileHandle *' with an rvalue of type 'bool'
      return false;
             ^~~~~

I have no idea how to proceed.

Revision history for this message
RJVB (rjvbertin) said :
#2

OK, it may be that I just have to trace down and eliminate all -Werror compiler arguments. Thanks.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Maybe changing "return false" to "return NULL", or "return (ImportFileHandle *) 0", or something like that is also a possible solution.

Revision history for this message
RJVB (rjvbertin) said :
#4

That would be the cleaner solution, or simply cast `false` to the appropriate type.

Or simply revert the offending file to good ole C :))

Can you help with this problem?

Provide an answer of your own, or ask RJVB for more information if necessary.

To post a message you must log in.