Skip to content

compilation warnings in _macosx.m #1013

Closed

Description

@efiring

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
      'id'
    [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.

Activity

  1. pmarshwx commented on Jul 15, 2012

    @pmarshwx

    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.

  2. efiring commented on Jul 16, 2012

    @efiring
    MemberAuthor

    Patrick,

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

    Eric

  3. pmarshwx commented on Jul 16, 2012

    @pmarshwx

    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

  4. mdehoon commented on Jul 22, 2012

    @mdehoon
    Contributor

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

    #1034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions