Skip to content

Bug: protobject seems deprecated (and can't compile) #86

Description

@dumblob

The protobject module seems deprecated and unmaintained. It also can't compile:

cc -O2 -DDAO_WITH_NUMARRAY -DDAO_WITH_THREAD -DDAO_WITH_CONCURRENT -DDAO_WITH_RESTART -DTARGET_PLAT=\"linux\" -DLINUX=2 -DUNIX=1 -I../../kernel/ -I../auxlib/ -I. -fPIC  -c dao_protobject.c -o DaoMake.Objs/dao_protobject.c.75B9.o
dao_protobject.c:121:8: error: unknown type name ‘DaoFuncItem’
 static DaoFuncItem protobjectMeths[]=
        ^~~~~~~~~~~
dao_protobject.c:123:2: warning: braces around scalar initializer
  { PROTOBJ_New,       "Protobject()=>Protobject" },
  ^
dao_protobject.c:123:2: note: (near initialization for ‘protobjectMeths[0]’)
dao_protobject.c:123:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
  { PROTOBJ_New,       "Protobject()=>Protobject" },
    ^~~~~~~~~~~
dao_protobject.c:123:4: note: (near initialization for ‘protobjectMeths[0]’)
dao_protobject.c:123:4: error: initializer element is not computable at load time
dao_protobject.c:123:4: note: (near initialization for ‘protobjectMeths[0]’)
dao_protobject.c:123:23: warning: excess elements in scalar initializer
  { PROTOBJ_New,       "Protobject()=>Protobject" },
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
dao_protobject.c:123:23: note: (near initialization for ‘protobjectMeths[0]’)
dao_protobject.c:125:2: warning: braces around scalar initializer
  { PROTOBJ_GetProto,  ".__proto__( self :Protobject ) => Protobject|none" },
  ^
dao_protobject.c:125:2: note: (near initialization for ‘protobjectMeths[1]’)
dao_protobject.c:125:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
  { PROTOBJ_GetProto,  ".__proto__( self :Protobject ) => Protobject|none" },
    ^~~~~~~~~~~~~~~~
dao_protobject.c:125:4: note: (near initialization for ‘protobjectMeths[1]’)
dao_protobject.c:125:4: error: initializer element is not computable at load time
dao_protobject.c:125:4: note: (near initialization for ‘protobjectMeths[1]’)
dao_protobject.c:125:23: warning: excess elements in scalar initializer
  { PROTOBJ_GetProto,  ".__proto__( self :Protobject ) => Protobject|none" },
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dao_protobject.c:125:23: note: (near initialization for ‘protobjectMeths[1]’)
dao_protobject.c:126:2: warning: braces around scalar initializer
  { PROTOBJ_SetProto,  ".__proto__=( self :Protobject, proto :Protobject|none )" },
  ^
dao_protobject.c:126:2: note: (near initialization for ‘protobjectMeths[2]’)
dao_protobject.c:126:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
  { PROTOBJ_SetProto,  ".__proto__=( self :Protobject, proto :Protobject|none )" },
    ^~~~~~~~~~~~~~~~
dao_protobject.c:126:4: note: (near initialization for ‘protobjectMeths[2]’)
dao_protobject.c:126:4: error: initializer element is not computable at load time
dao_protobject.c:126:4: note: (near initialization for ‘protobjectMeths[2]’)
dao_protobject.c:126:23: warning: excess elements in scalar initializer
  { PROTOBJ_SetProto,  ".__proto__=( self :Protobject, proto :Protobject|none ) },
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dao_protobject.c:126:23: note: (near initialization for ‘protobjectMeths[2]’)
dao_protobject.c:128:2: warning: braces around scalar initializer
  { PROTOBJ_GetField,  ".( self :Protobject, field :string ) => any" },
  ^
dao_protobject.c:128:2: note: (near initialization for ‘protobjectMeths[3]’)
dao_protobject.c:128:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
  { PROTOBJ_GetField,  ".( self :Protobject, field :string ) => any" },
    ^~~~~~~~~~~~~~~~
dao_protobject.c:128:4: note: (near initialization for ‘protobjectMeths[3]’)
dao_protobject.c:128:4: error: initializer element is not computable at load time
dao_protobject.c:128:4: note: (near initialization for ‘protobjectMeths[3]’)
dao_protobject.c:128:23: warning: excess elements in scalar initializer
  { PROTOBJ_GetField,  ".( self :Protobject, field :string ) => any" },
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dao_protobject.c:128:23: note: (near initialization for ‘protobjectMeths[3]’)
dao_protobject.c:129:2: warning: braces around scalar initializer
  { PROTOBJ_SetField,  ".=( self :Protobject, field :string, value :any )" },
  ^
dao_protobject.c:129:2: note: (near initialization for ‘protobjectMeths[4]’)
dao_protobject.c:129:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
  { PROTOBJ_SetField,  ".=( self :Protobject, field :string, value :any )" },
    ^~~~~~~~~~~~~~~~
dao_protobject.c:129:4: note: (near initialization for ‘protobjectMeths[4]’)
dao_protobject.c:129:4: error: initializer element is not computable at load time
dao_protobject.c:129:4: note: (near initialization for ‘protobjectMeths[4]’)
dao_protobject.c:129:23: warning: excess elements in scalar initializer
  { PROTOBJ_SetField,  ".=( self :Protobject, field :string, value :any )" },
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dao_protobject.c:129:23: note: (near initialization for ‘protobjectMeths[4]’)
dao_protobject.c:131:2: warning: braces around scalar initializer
  { NULL, NULL },
  ^
dao_protobject.c:131:2: note: (near initialization for ‘protobjectMeths[5]’)
dao_protobject.c:131:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
  { NULL, NULL },
    ^~~~
dao_protobject.c:131:4: note: (near initialization for ‘protobjectMeths[5]’)
dao_protobject.c:142:1: error: unknown type name ‘DaoTypeBase’
 DaoTypeBase protobjectTyper =
 ^~~~~~~~~~~
dao_protobject.c:144:2: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
  "Protobject", NULL, NULL, (DaoFuncItem*) protobjectMeths, {0}, {0},
  ^~~~~~~~~~~~
dao_protobject.c:144:2: note: (near initialization for ‘protobjectTyper’)
dao_protobject.c:144:2: error: initializer element is not computable at load time
dao_protobject.c:144:2: note: (near initialization for ‘protobjectTyper’)
dao_protobject.c:144:29: error: ‘DaoFuncItem’ undeclared here (not in a function)
  "Protobject", NULL, NULL, (DaoFuncItem*) protobjectMeths, {0}, {0},
                             ^~~~~~~~~~~
dao_protobject.c:144:41: error: expected expression before ‘)’ token
  "Protobject", NULL, NULL, (DaoFuncItem*) protobjectMeths, {0}, {0},
                                         ^
dao_protobject.c:144:40: error: invalid operands to binary * (have ‘int *’ and int *’)
  "Protobject", NULL, NULL, (DaoFuncItem*) protobjectMeths, {0}, {0},
                             ~~~~~~~~~~~^
dao_protobject.c:144:28: warning: excess elements in scalar initializer
  "Protobject", NULL, NULL, (DaoFuncItem*) protobjectMeths, {0}, {0},
                            ^
dao_protobject.c:144:28: note: (near initialization for ‘protobjectTyper’)
dao_protobject.c: In function ‘DaoProtobject_OnLoad’:
dao_protobject.c:151:52: warning: passing argument 2 of ‘DaoNamespace_WrapType’ from incompatible pointer type [-Wincompatible-pointer-types]
  daox_type_protobject = DaoNamespace_WrapType( ns, & protobjectTyper, DAO_CSTRUCT, 0 );
                                                    ^
In file included from ../../kernel/daoBase.h:34:0,
                 from ../../kernel/daoType.h:32,
                 from ../../kernel/daoValue.h:32,
                 from dao_protobject.c:31:
../../kernel/dao.h:1132:18: note: expected ‘DaoTypeCore * {aka struct DaoTypeCore *}’ but argument is of type ‘int *’
 DAO_DLL DaoType* DaoNamespace_WrapType( DaoNamespace *self, DaoTypeCore *core, int tid, int options );
                  ^~~~~~~~~~~~~~~~~~~~~

It seems useful (e.g. for mocking and unit testing), so we should either update it to the latest Dao or abandon it completely and remove it from this repository.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions