[MacPorts] #63463: python27 @2.7.18_3+universal: error: implicit declaration of function 'CtlObj_New' is invalid in C99 (was: python27 @2.7.18_3+universal: ImportError: No module named _Res)

MacPorts noreply at macports.org
Tue Nov 9 17:07:29 UTC 2021


#63463: python27 @2.7.18_3+universal: error: implicit declaration of function
'CtlObj_New' is invalid in C99
-------------------------+----------------------
  Reporter:  ryandesign  |      Owner:  jmroot
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.7.1
Resolution:              |   Keywords:
      Port:  python27    |
-------------------------+----------------------

Comment (by ryandesign):

 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.
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/63463#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list