Build failure on 10.6.8: `_runtime.h: error: expected ';', ',' or ')' before 'self'`
- Dominant language
- Python
- Stars
- 192
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
Not that I have high hopes here, but is it possible to fix this for 10.6 with some minimal changes?
```
building 'pyobjus' extension
creating build/temp.macosx-10.6-ppc-cpython-312/pyobjus
/opt/local/bin/gcc-mp-14 -Os -arch ppc -isysroot/ -I/opt/local/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c pyobjus/pyobjus.c -o build/temp.macosx-10.6-ppc-cpython-312/pyobjus/pyobjus.o
In file included from pyobjus/pyobjus.c:760:
pyobjus/_runtime.h: In function 'allocAndInitAutoreleasePool':
pyobjus/_runtime.h:34:11: warning: function called through a non-compatible type
34 | return ((id (*)(id, SEL)) objc_msgSend)(pool, sel_registerName("init"));
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/_runtime.h: In function 'drainAutoreleasePool':
pyobjus/_runtime.h:38:10: warning: function called through a non-compatible type
38 | (void)((id (*)(id, SEL)) objc_msgSend)(pool, sel_registerName("drain"));
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/_runtime.h: In function 'objc_msgSend_custom':
pyobjus/_runtime.h:42:11: warning: function called through a non-compatible type
42 | return ((id (*)(id, SEL)) objc_msgSend)(obj, sel);
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/_runtime.h: At top level:
pyobjus/_runtime.h:52:46: error: expected ';', ',' or ')' before 'self'
52 | void objc_msgSend_stret__safe(id _Nullable self, SEL _Nonnull op){
| ^~~~
pyobjus/_runtime.h:58:57: error: expected ';', ',' or ')' before 'cif'
58 | ffi_status guarded_ffi_prep_cif_var(ffi_cif *_Nonnull cif, ffi_abi abi, unsigned int nfixedargs,
| ^~~
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_6CArray_get_object_list':
pyobjus/pyobjus.c:11544:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
11544 | __pyx_v_array = ((id *)__pyx_v_ptr);
| ^
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_6CArray_get_class_list':
pyobjus/pyobjus.c:11658:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
11658 | __pyx_v_array = ((Class *)__pyx_v_ptr);
| ^
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_6CArray_get_sel_list':
pyobjus/pyobjus.c:11780:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
11780 | __pyx_v_array = ((SEL *)__pyx_v_ptr);
| ^
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_6CArray_as_struct_array':
pyobjus/pyobjus.c:14173:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
14173 | (__pyx_v_cgrect_array[__pyx_v_i]) = (((CGRect *)((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_10)))[0]);
| ^
pyobjus/pyobjus.c:14321:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
14321 | (__pyx_v_cgsize_array[__pyx_v_i]) = (((CGSize *)((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_10)))[0]);
| ^
pyobjus/pyobjus.c:14469:58: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
14469 | (__pyx_v_cgpoint_array[__pyx_v_i]) = (((CGPoint *)((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_10)))[0]);
| ^
pyobjus/pyobjus.c:14617:58: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
14617 | (__pyx_v_cfrange_array[__pyx_v_i]) = (((CFRange *)((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_10)))[0]);
| ^
pyobjus/pyobjus.c:14753:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
14753 | (__pyx_v_id_array[__pyx_v_i]) = (((id *)((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_10)))[0]);
| ^
pyobjus/pyobjus.c: In function '__pyx_pf_7pyobjus_12ObjcProperty___cinit__':
pyobjus/pyobjus.c:21531:55: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
21531 | (__pyx_v_self->property[0]) = (((objc_property_t *)((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_1)))[0]);
| ^
pyobjus/pyobjus.c:21541:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
21541 | (__pyx_v_self->ivar[0]) = (((Ivar *)((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_1)))[0]);
| ^
pyobjus/pyobjus.c: In function '__pyx_pf_7pyobjus_14dereference':
pyobjus/pyobjus.c:27280:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
27280 | __pyx_v_c_addr = ((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_4));
| ^
pyobjus/pyobjus.c:27301:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
27301 | __pyx_v_c_addr = ((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_4));
| ^
pyobjus/pyobjus.c:27373:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
27373 | __pyx_t_5 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)__pyx_v_c_addr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 41, __pyx_L1_error)
| ^
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_convert_cy_ret_to_py':
pyobjus/pyobjus.c:29631:45: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
29631 | __pyx_t_2 = __Pyx_PyInt_From_int(((int)((char)(__pyx_v_f_result[0])))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 204, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:29700:41: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
29700 | __pyx_t_4 = __Pyx_PyInt_From_short(((short)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 208, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:29766:48: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
29766 | __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(((PY_LONG_LONG)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 212, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:29799:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
29799 | __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(((unsigned char)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 214, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:29865:50: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
29865 | __pyx_t_4 = __Pyx_PyInt_From_unsigned_short(((unsigned short)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 218, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:29931:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
29931 | __pyx_t_4 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 222, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:29969:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
29969 | __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)__pyx_v_f_result)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 224, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:30092:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
30092 | __pyx_t_3 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)__pyx_v_f_result)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 226, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:30555:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
30555 | __pyx_t_4 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 258, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:30577:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
30577 | __pyx_t_4 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 259, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:30722:62: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
30722 | __pyx_t_10 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)__pyx_v_f_result)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 262, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:31142:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
31142 | __pyx_v_c_addr = ((unsigned PY_LONG_LONG)__pyx_v_f_result);
| ^
pyobjus/pyobjus.c:31162:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
31162 | __pyx_v_c_addr = ((unsigned PY_LONG_LONG)(__pyx_v_f_result[0]));
| ^
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_convert_py_arg_to_cy':
pyobjus/pyobjus.c:34663:30: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
34663 | __pyx_v_arg_val_ptr = ((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_11));
| ^
pyobjus/pyobjus.c:34739:30: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
34739 | __pyx_v_arg_val_ptr = ((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_11));
| ^
pyobjus/pyobjus.c:37408:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
37408 | __pyx_v_str_long_ptr = ((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_11));
| ^
pyobjus/pyobjus.c:37419:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
37419 | __pyx_t_8 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)__pyx_v_str_long_ptr)); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 665, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:37490:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
37490 | __pyx_v_str_long_ptr = ((unsigned PY_LONG_LONG *)((unsigned PY_LONG_LONG)__pyx_t_11));
| ^
pyobjus/pyobjus.c:37615:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
37615 | (((void **)__pyx_v_val_ptr)[0]) = ((void *)((unsigned PY_LONG_LONG)__pyx_t_11));
| ^
pyobjus/pyobjus.c:37803:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
37803 | (((void **)__pyx_v_val_ptr)[0]) = ((void *)((unsigned PY_LONG_LONG)__pyx_t_11));
| ^
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_10ObjcMethod_ensure_method':
pyobjus/pyobjus.c:41820:22: error: implicit declaration of function 'guarded_ffi_prep_cif_var' [-Wimplicit-function-declaration]
41820 | __pyx_v_f_status = guarded_ffi_prep_cif_var((&__pyx_v_self->f_cif), FFI_DEFAULT_ABI, __pyx_v_num_fixed_args, __pyx_v_num_args, __pyx_v_self->f_result_type, __pyx_v_self->f_arg_types);
| ^~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c: In function '__pyx_pf_7pyobjus_10ObjcMethod_10__call__':
pyobjus/pyobjus.c:43891:75: error: 'objc_msgSend_stret__safe' undeclared (first use in this function); did you mean 'objc_msgSend_stret'?
43891 | ffi_call((&__pyx_v_self->f_cif), ((void (*)(void))((id (*)(id, SEL))objc_msgSend_stret__safe)), __pyx_v_res_ptr, __pyx_v_f_args);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| objc_msgSend_stret
pyobjus/pyobjus.c:43891:75: note: each undeclared identifier is reported only once for each function it appears in
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_get_class_properties':
pyobjus/pyobjus.c:45764:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
45764 | __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)(&(__pyx_v_properties[__pyx_v_i])))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
| ^
pyobjus/pyobjus.c:45768:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
45768 | __pyx_t_6 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)(&__pyx_v_ivar))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 655, __pyx_L1_error)
| ^
pyobjus/pyobjus.c: In function '__pyx_f_7pyobjus_protocol_forwardInvocation':
pyobjus/pyobjus.c:48725:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
48725 | __pyx_t_3 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(((unsigned PY_LONG_LONG)(&__pyx_v_c_arg))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
| ^
error: command '/opt/local/bin/gcc-mp-14' failed with exit code 1
Command failed: cd "/opt/local/var/macports/build/py312-pyobjus-a0c31f18/work/pyobjus-1.2.3" && /opt/local/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12 setup.py --no-user-cfg build -j6
Exit code: 1
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the macOS 10.6 PPC build command shown in the report, then inspect the declarations around lines 52 and 58 of pyobjus/_runtime.h and the guarded_ffi_prep_cif_var call in pyobjus/pyobjus.c. Done means the extension builds successfully on the reported Python 3.12 and 10.6 PPC environment without these compilation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, objective-c, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100