two warning on build samba-3.0.15pre2

Дейтер Александр В Дейтер Александр В
Thu Apr 21 13:50:48 GMT 2005


derrell at samba.org wrote	:

>>        size_t ret = iconv((iconv_t)cd,
>>-                          CONST_DISCARD(char **, inbuf), inbytesleft,
>>+                          inbuf, inbytesleft,
> 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).

FreeBSD 5.3 + libiconv-1.9.2 (from http://www.gnu.org/software/libiconv)

/usr/local/include/iconv.h:
extern size_t iconv (iconv_t cd, const char* * inbuf, size_t 
*inbytesleft, char* * outbuf, size_t *outbytesleft);

>>-       utctime = localtime(&smb_last_time.tv_sec);
>>+       utctime = localtime((time_t *) &smb_last_time.tv_sec);
> 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.

/usr/include/sys/time.h:
#include <sys/_timeval.h>

/usr/include/sys/_timeval.h:
struct timeval {
         long            tv_sec;         /* seconds (XXX should be 
time_t) */
         suseconds_t     tv_usec;        /* and microseconds */
};

source/utils/status.c also contain code:
asctime(LocalTime((time_t *)&e->time.tv_sec)));

Thanks a lot!

-- 
Alex Deiter


More information about the samba-technical mailing list