Opened 3 years ago

Last modified 2 years ago

#63463 assigned defect

python27 @2.7.18_3+universal: error: implicit declaration of function 'CtlObj_New' is invalid in C99

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: python27

Description

I can't upgrade python27 +univeral from 2.7.18_2 to 2.7.18_3 on High Sierra. It fails in the destroot phase:

Traceback (most recent call last):
  File "./scripts/cachersrc.py", line 7, in <module>
    import macresource
  File "/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_lang_python27/python27/work/Python-2.7.18/Lib/plat-mac/macresource.py", line 6, in <module>
    from Carbon import Res
  File "/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_lang_python27/python27/work/Python-2.7.18/Lib/plat-mac/Carbon/Res.py", line 4, in <module>
    from _Res import *
ImportError: No module named _Res
make[1]: *** [installmacsubtree] Error 1

Attachments (1)

main.log.bz2 (43.4 KB) - added by ryandesign (Ryan Carsten Schmidt) 3 years ago.

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log.bz2 added

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: python27 @2.7.18_3: ImportError: No module named _Respython27 @2.7.18_3+universal: ImportError: No module named _Res

I also tried with trace mode and the problem remains.

No problem when not using the universal variant.

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: python27 @2.7.18_3+universal: ImportError: No module named _Respython27 @2.7.18_3+universal: error: implicit declaration of function 'CtlObj_New' is invalid in C99

It's because I'm using -Werror=implicit-function-declaration in CFLAGS; if I don't do that, it builds.

building '_Res' extension
creating build/temp.macosx-10.13-intel-2.7/.../python27/work/Python-2.7.18/Mac/Modules/res
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -Os -Werror=implicit-function-declaration -arch x86_64 -arch i386 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/.../python27/work/Python-2.7.18/Mac/Include -I. -IInclude -I./Include -I/opt/local/include -I/opt/local/include/db48 -I/.../python27/work/Python-2.7.18/Include -I/.../python27/work/Python-2.7.18 -c /.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.c -o build/temp.macosx-10.13-intel-2.7/.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.o -Wno-deprecated-declarations
/.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.c:421:12: error: implicit declaration of function 'CtlObj_New' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    _res = CtlObj_New((ControlHandle)_self->ob_itself);
           ^
/.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.c:421:12: warning: this function declaration is not a prototype [-Wstrict-prototypes]
/.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.c:421:10: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
    _res = CtlObj_New((ControlHandle)_self->ob_itself);
         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.c:430:12: error: implicit declaration of function 'MenuObj_New' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    _res = MenuObj_New((MenuHandle)_self->ob_itself);
           ^
/.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.c:430:12: note: did you mean 'ResObj_New'?
Include/pymactoolbox.h:190:18: note: 'ResObj_New' declared here
extern PyObject *ResObj_New(Handle);
                 ^
/.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.c:430:12: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    _res = MenuObj_New((MenuHandle)_self->ob_itself);
           ^
/.../python27/work/Python-2.7.18/Mac/Modules/res/_Resmodule.c:430:10: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
    _res = MenuObj_New((MenuHandle)_self->ob_itself);
         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings and 2 errors generated.

comment:3 Changed 2 years ago by jmroot (Joshua Root)

The _Res extension is not guarding its use of those functions with #if APPLE_SUPPORTS_QUICKTIME as it should, and the _CG extension is using some deprecated functions that it looks like aren't even declared in the 10.13 SDK headers. But I think that if you try with the current version, you'll get a successful build, just without those modules, which is probably acceptable.

Note: See TracTickets for help on using tickets.