1. Ronald Oussoren
  2. pyobjc

Issues

Issue #84 resolved

PyObjc 3.0 (default branch) a few warnings during the build from source

Marc Van Olmen
created an issue

Hi,

  • Building on 10.9.3
  • Xcode 5.1.1
  • Python 2.7.5
  • Saw these warnings:
Modules/objc/OC_PythonNumber.m:13:20: warning: incompatible pointer types returning 'NSNumber *' from a function with result type 'OC_PythonNumber *' [-Wincompatible-pointer-types]
            return [[NSNumber alloc] initWithUnsignedLongLong:lv];
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:75:1: note: instance method 'initWithUnsignedLongLong:' is assumed to return an instance of its
      receiver type ('NSNumber *')
- (id)initWithUnsignedLongLong:(unsigned long long)value;
^
Modules/objc/OC_PythonNumber.m:5:3: note: current method is explicitly declared 'instancetype' and is expected to return an instance of its class type
+(instancetype)numberWithPythonObject:(PyObject*)v
  ^~~~~~~~~~~~
1 warning generated.
Modules/objc/OC_PythonNumber.m:13:20: warning: incompatible pointer types returning 'NSNumber *' from a function with result type 'OC_PythonNumber *' [-Wincompatible-pointer-types]
            return [[NSNumber alloc] initWithUnsignedLongLong:lv];
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:75:1: note: instance method 'initWithUnsignedLongLong:' is assumed to return an instance of its
      receiver type ('NSNumber *')
- (id)initWithUnsignedLongLong:(unsigned long long)value;
^
Modules/objc/OC_PythonNumber.m:5:3: note: current method is explicitly declared 'instancetype' and is expected to return an instance of its class type

and a little further:

libffi-src/ffi.c:107:1: warning: unused function 'struct_on_stack' [-Wunused-function]
struct_on_stack(
^

Comments (2)

  1. Ronald Oussoren repo owner

    Thank's for the report.

    The warnings are harmless: The one for OC_PythonNumer is due to a workaround for a bug, for some reason I can't get OC_PythonNumber instances with (very) large unsigned values to roundtrip correctly to an NSArchive. Because of that those values are now proxied using a plain NSNumber. I've added some clang pragma's to suppress that warning for now.

    The one in ffi.c was due to a missing preprocessor guard.

  2. Log in to comment