Skip to content

_macosx.m fails to compile on Mac OS 10.6.8 Snow Leopard #10516

Closed
@fvaccari

Description

@fvaccari

Bug report

Bug summary

Compilation fails in MacPorts on Snow Leopard with this error message due to code in _macosx.m:

:info:build src/_macosx.m:1313: error: ‘for’ loop initial declaration used outside C99 mode
:info:build error: command '/usr/bin/llvm-gcc-4.2' failed with exit status 1

Current statement

As I see it is currently line 1310 of _macosx.m:

for (size_t state_index = 0; state_index < n; state_index++)

Proposed syntax

This syntax allows for proper compilation, and should not break on more modern systems

size_t state_index;
for (state_index = 0; state_index < n; state_index++)

Matplotlib version

  • Operating system: Mac OS X 10.6.8 Snow Leopard
  • Matplotlib version: py36-matplotlib @2.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.6.4
  • Jupyter version (if applicable):
  • Other libraries:

Installed with MacPorts

  • 2.4.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions