two warning on build samba-3.0.15pre2

derrell at samba.org derrell at samba.org
Thu Apr 21 13:32:31 GMT 2005


Дейтер Александр Валериевич <tiamat at komi.mts.ru> writes:

> Hi,
>
> build samba-3.0.15pre2 show me only two warning:
>
> Compiling lib/iconv.c
> lib/iconv.c: In function `sys_iconv':
> lib/iconv.c:139: warning: passing arg 2 of `libiconv' from incompatible 
> pointer type
>
> --- source/lib/iconv.c.orig    Thu Apr 21 16:11:14 2005
> +++ source/lib/iconv.c Thu Apr 21 16:13:01 2005
> @@ -135,7 +135,7 @@
>  {
>  #ifdef HAVE_NATIVE_ICONV
>         size_t ret = iconv((iconv_t)cd,
> -                          CONST_DISCARD(char **, inbuf), inbytesleft,
> +                          inbuf, inbytesleft,
>                            outbuf, outbytesleft);
>         if (ret == (size_t)-1) {
>                 int saved_errno = errno;

The local variable "inbuf" here is of type (const char **).

The second parameter to iconv(), as specified in my Linux documentation and in
<iconv.h>, is type (char **).

What OS are you running, and how is iconv() declared in <iconv.h>?  This
sounds like a difference in standard function declaration (sigh).

> Compiling auth/auth_sam.c
> auth/auth_sam.c: In function `logon_hours_ok':
> auth/auth_sam.c:89: warning: passing arg 1 of `localtime' from 
> incompatible pointer type
>
> --- source/auth/auth_sam.c.orig        Thu Apr 21 16:16:38 2005
> +++ source/auth/auth_sam.c     Thu Apr 21 16:16:50 2005
> @@ -86,7 +86,7 @@
>                 return True;
>         }
>
> -       utctime = localtime(&smb_last_time.tv_sec);
> +       utctime = localtime((time_t *) &smb_last_time.tv_sec);
>
>         /* find the corresponding byte and bit */
>         bitpos = (utctime->tm_wday * 24 + utctime->tm_hour) % 168;

Again, something is strange here.  tv_sec in a (struct timeval) should already
be a (time_t).  Would you please look in <time.h> or something included by
<time.h>, to find out how tv_sec in (struct timeval) is declared on your
system.

Thanks,

Derrell


More information about the samba-technical mailing list