Re: Compiler warnings: Unsigned char ....

Jeremy Allison (jeremy@java.netapp.com)
Wed, 29 Apr 1998 22:44:08 -0700

Date:	Wed, 29 Apr 1998 22:44:08 -0700
From:	Jeremy Allison <jeremy@java.netapp.com>
Message-Id: <199804300544.WAA00534@java.netapp.com>
To:	samba-technical@samba.anu.edu.au, sharpe@ns.aus.com
Subject: Re: Compiler warnings: Unsigned char ....

Richard Sharp wrote

>Compiling reply.c
>cc: Warning: reply.c, line 408: In this statement, the referenced type of
the
>pointer value "smb_passwd" is "signed char", which is not compatible with
>"unsigned char".
> if (!smb_password_ok(smb_trust_acct, smb_passwd,
>mb_nt_passwd))
>---------------------^

> This is caused by he define in smb.h of BOOL:

Actually, no, I think it's caused by the signed/unsigned char
missmatch between the (char *)smb_passwd parameter and the
unsigned char that the smb_password_ok() function expects.

Please don't change BOOL as it's not the problem here.

The problem is I haven't found a gcc flag that will turn
on signed/unsigned warnings in parameter passing so more
picky compilers keep catching these things. The best thing
is to add a cast in the correct position to match the
expected parameter, it's not BOOL's fault honest :-).

Every so often Herb mails me a bunch of these warnings
and I fix them - I'll probably only fix them every time
I check in when Herb gets me the SGI O2 machine + compilers
he's hoping to get for me :-).

Cheers (posting this from home 'cos I'm a sad git with
no life :-).

Jeremy.