Skip to content

Matplotlib does not build on OpenBSD using clang #11484

Closed
@dahlbaek

Description

@dahlbaek

Bug report

Bug summary

On OpenBSD using the default compiler (clang), matplotlib currently does not build due to cast from pointer to smaller type 'char'.

Code for reproduction

export CC=clang CXX=clang++

python3 -m venv venv &&
. venv/bin/activate &&
pip install --upgrade pip &&
pip install --upgrade numpy cycler pyparsing python-dateutil pytz six kiwisolver &&
pip install --upgrade matplotlib >clang.log 2>&1

Actual outcome

    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fPIC -O2 -pipe -O2 -pipe -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ttconv_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/home/dahlbaek/test_matplotlib/venv/lib/python3.6/site-packages/numpy/core/include -Iextern -I/usr/local/include -I/usr/include -I. -I/home/dahlbaek/test_matplotlib/venv/include -I/usr/local/include/python3.6m -c extern/ttconv/pprdrv_tt.cpp -o build/temp.openbsd-6.3-amd64-3.6/extern/ttconv/pprdrv_tt.o
    extern/ttconv/pprdrv_tt.cpp:248:41: error: cast from pointer to smaller type 'char' loses information
                    font->Copyright[length]=(char)NULL;
                                            ^~~~~~~~~~
    extern/ttconv/pprdrv_tt.cpp:264:42: error: cast from pointer to smaller type 'char' loses information
                    font->FamilyName[length]=(char)NULL;
                                             ^~~~~~~~~~
    extern/ttconv/pprdrv_tt.cpp:280:37: error: cast from pointer to smaller type 'char' loses information
                    font->Style[length]=(char)NULL;
                                        ^~~~~~~~~~
    extern/ttconv/pprdrv_tt.cpp:296:40: error: cast from pointer to smaller type 'char' loses information
                    font->FullName[length]=(char)NULL;
                                           ^~~~~~~~~~
    extern/ttconv/pprdrv_tt.cpp:312:39: error: cast from pointer to smaller type 'char' loses information
                    font->Version[length]=(char)NULL;
                                          ^~~~~~~~~~
    extern/ttconv/pprdrv_tt.cpp:328:40: error: cast from pointer to smaller type 'char' loses information
                    font->PostName[length]=(char)NULL;
                                           ^~~~~~~~~~
    extern/ttconv/pprdrv_tt.cpp:343:42: error: cast from pointer to smaller type 'char' loses information
                    font->PostName[length/2]=(char)NULL;
                                             ^~~~~~~~~~
    extern/ttconv/pprdrv_tt.cpp:358:41: error: cast from pointer to smaller type 'char' loses information
                    font->Trademark[length]=(char)NULL;
                                            ^~~~~~~~~~
    extern/ttconv/pprdrv_tt.cpp:1044:19: error: cast from pointer to smaller type 'char' loses information
            temp[len]=(char)NULL;   /* a buffer and make it ASCIIz. */
                      ^~~~~~~~~~
    9 errors generated.
    error: command 'clang' failed with exit status 1

For full output, see clang.log

Expected outcome

Expected outcome is that matplotlib builds without complication.

Matplotlib version

  • Operating system: OpenBSD 6.3 amd64
  • Matplotlib version: 2.2.2
  • Matplotlib backend (print(matplotlib.get_backend())): NA
  • Python version: 3.6.5
  • Jupyter version (if applicable): NA
  • Other libraries:
$ clang -v
OpenBSD clang version 6.0.0 (tags/RELEASE_600/final) (based on LLVM 6.0.0)
Target: amd64-unknown-openbsd6.3
Thread model: posix

Python3 was installed using the OpenBSD package system,

pkg_add python-3.6.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions