Question about registry operating functions

Igor Chudov nir at basealt.ru
Wed May 19 11:02:29 UTC 2021


Hi all,

I want to link against `source3/registry/reg_objects.c` but keep getting 
errors like:

```
[4336/4410] Compiling source3/registry/reg_objects.c
../../source3/registry/reg_objects.c:38:2: error: unknown type name 
‘fstring’
   fstring  valuename;
   ^~~~~~~
../../source3/registry/reg_objects.c: In function 
‘regsubkey_ctr_key_exists’:
../../source3/registry/reg_objects.c:287:10: error: ‘False’ undeclared 
(first use in this function); did you mean ‘false’?
    return False;
           ^~~~~
           false
../../source3/registry/reg_objects.c:287:10: note: each undeclared 
identifier is reported only once for each function it appears in
../../source3/registry/reg_objects.c: In function ‘regval_name’:
../../source3/registry/reg_objects.c:370:12: error: returning ‘int’ from 
a function with return type ‘char *’ makes pointer from integer without 
a cast [-Werror=int-conversion]
   return val->valuename;
          ~~~^~~~~~~~~~~
../../source3/registry/reg_objects.c: In function ‘regval_ctr_value_exists’:
../../source3/registry/reg_objects.c:404:32: error: passing argument 1 
of ‘strequal’ makes pointer from integer without a cast 
[-Werror=int-conversion]
    if ( strequal( ctr->values[i]->valuename, value) )
                   ~~~~~~~~~~~~~~^~~~~~~~~~~
In file included from ../../source4/include/includes.h:62,
                  from ../../source3/registry/reg_objects.c:23:
../../source3/../lib/util/samba_util.h:343:36: note: expected ‘const 
char *’ but argument is of type ‘int’
  _PUBLIC_ bool strequal(const char *s1, const char *s2);
                         ~~~~~~~~~~~~^~
../../source3/registry/reg_objects.c:405:11: error: ‘True’ undeclared 
(first use in this function); did you mean ‘true’?
     return True;
            ^~~~
            true
../../source3/registry/reg_objects.c:408:9: error: ‘False’ undeclared 
(first use in this function); did you mean ‘false’?
   return False;
          ^~~~~
          false
../../source3/registry/reg_objects.c: In function ‘regval_ctr_value_byname’:
../../source3/registry/reg_objects.c:420:30: error: passing argument 1 
of ‘strequal’ makes pointer from integer without a cast 
[-Werror=int-conversion]
    if (strequal(ctr->values[i]->valuename, value)) {
                 ~~~~~~~~~~~~~~^~~~~~~~~~~
In file included from ../../source4/include/includes.h:62,
                  from ../../source3/registry/reg_objects.c:23:
../../source3/../lib/util/samba_util.h:343:36: note: expected ‘const 
char *’ but argument is of type ‘int’
  _PUBLIC_ bool strequal(const char *s1, const char *s2);
                         ~~~~~~~~~~~~^~
In file included from ../../source3/registry/reg_objects.c:30:
../../source3/registry/reg_objects.c: In function ‘regval_compose’:
../../lib/util/string_wrappers.h:40:54: error: ‘fstring’ undeclared 
(first use in this function); did you mean ‘isprint’?
   strlcpy((d),_fstrcpy_src ? _fstrcpy_src : "",sizeof(fstring)); \
                                                       ^~~~~~~
../../source3/registry/reg_objects.c:443:2: note: in expansion of macro 
‘fstrcpy’
   fstrcpy(regval->valuename, name);
   ^~~~~~~
../../source3/registry/reg_objects.c:443:16: error: passing argument 1 
of ‘strlcpy’ makes pointer from integer without a cast 
[-Werror=int-conversion]
   fstrcpy(regval->valuename, name);
../../lib/util/string_wrappers.h:40:11: note: in definition of macro 
‘fstrcpy’
   strlcpy((d),_fstrcpy_src ? _fstrcpy_src : "",sizeof(fstring)); \
            ^
In file included from ../../lib/replace/../replace/replace.h:176,
                  from ../../source4/include/includes.h:23,
                  from ../../source3/registry/reg_objects.c:23:
/usr/include/string.h:466:41: note: expected ‘char * restrict’ but 
argument is of type ‘int’
  extern size_t strlcpy (char *__restrict __dest,
                         ~~~~~~~~~~~~~~~~~^~~~~~
```

Could anyone possibly point me to the way to build reg_objects.c 
successfully so I will be able to link against it? Maybe I need to add 
some target?

-- 
With best regards, Igor Chudov
Lead engineer
BaseALT, Saratov engineering department, UTC+4
tel. +7 495 1234-7-99 ext. 549
mobile +7 937 266-51-34



More information about the samba-technical mailing list