compilation warnings in _macosx.m #1013

efiring opened this Issue Jul 15, 2012 · 4 comments


None yet

3 participants

efiring commented Jul 15, 2012

Compiling _macosx.m on Lion gives 3 warnings:

running build_ext
gcc-4.2 not found, using clang instead
building 'matplotlib.backends._macosx' extension
clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I/usr/X11/include -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I/usr/X11/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_macosx.m -o build/temp.macosx-10.6-intel-2.7/src/_macosx.o
src/_macosx.m:3808:26: warning: sending 'View *' to parameter of incompatible type
    [window setDelegate: view];
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:308:44: note: passing
      argument to parameter 'anObject' here
- (void)setDelegate:(id )anObject;
src/_macosx.m:4253:20: warning: incompatible pointer types assigning to
      'ScrollableButton *' from 'NSButton *' [-Wincompatible-pointer-types]
            button = [NSButton alloc];
                   ^ ~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:1: note: class
      method 'alloc' is assumed to return an instance of its receiver type ('NSButton *')
+ (id)alloc;
src/_macosx.m:4932:31: warning: 'filename' is deprecated [-Wdeprecated-declarations]
        NSString* filename = [panel filename];
3 warnings generated.

Although these may be harmless, it would be nicer if they could be avoided entirely.


Hi, Eric,

I'm relatively new here, but when I just went and compiled MPL just now I didn't have any errors on OS X Lion using clang. Granted, I'm not sure if you have more robust error checking turned on than I, but thought I'd offer my experience.

efiring commented Jul 16, 2012


All I did was "python build; python install", so no extra flags. This is with 2.7.3 and XCode 4.3.3. What XCode version do you have?



That's what I did as well, although technically I did use the --user flag. I'm using the version of python 2.7.3 built by homebrew and XCode Version 4.3.3 (4E3002). The clang compiler version

$ clang --version
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix

mdehoon commented Jul 22, 2012

With Mac OS X 10.7 I was still seeing these compiler warnings.
This pull request fixes them:


@efiring efiring closed this Jul 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment