ddale/mpl-issues

Fixing the build with clang

ddale opened this issue · 0 comments

Original report at SourceForge

I've attached a patch that fixes the matplotlib build with clang (http://clang.llvm.org). The underlying problem was that a typedef in scanline32_u8_am was misspelled, causing any instantiation in gcc to fail to build. But, since there are no instantiations, gcc didn't complain. Clang checks the class slightly earlier and complains even though it's unused. This patch deletes the unused template.

The change to extern "C" is needed to get clang to compile the code, but it's a result of a clang bug (http://llvm.org/PR6991) not a standards conformance bug in matplotlib.

SourceForge Comments

On Fri Jun 25 12:21:11 2010, jyasskin wrote:

I'm happy enough without the extern "C" bit in matplotlib. I'll push on the clang folks to fix their bug. Thanks!

On Thu Jun 24 14:27:57 2010, mdboom wrote:

The scanline32_u8_am typo is a good one, and is a nice argument in favor of using a compiler that does a little more upfront instantiation. This has been committed in r8465.

I'm a little more reluctant about the "extern "C"" piece, as it is a workaround for a compiler bug (not that there isn't precedent for that already in the matplotlib code). Would you mind taking this upstream to the CXX project (http://cxx.sourceforge.net/) since that's where the bug really lies (it just happens to be included verbatim in the matplotlib source tree).

On Fri Jun 18 16:36:40 2010, jyasskin wrote:

fix_typo.patch is an alternate patch that fixes the typo instead. It also fixes the clang build. You only need to apply one of the two patches.

SourceForge History

  • On Fri Jun 18 16:36:13 2010, by jyasskin: File Added: 377676: fix_typo.patch
  • On Fri Jun 18 16:33:09 2010, by jyasskin: File Added: 377675: delete_unused_class.patch