compiler found an error in handle_aio_read_complete

Andrew Bartlett abartlet at samba.org
Mon Jul 23 03:27:29 MDT 2012


On Mon, 2012-07-23 at 13:00 +1000, Andrew Bartlett wrote:
> Watching a build recently, I noticed:
> 
> ../source3/smbd/reply.c: In function ‘do_smb1_close’:
> ../source3/smbd/reply.c:4948:6: warning: pointer targets in passing argument 2 of ‘srv_send_smb’ differ in signedness [-Wpointer-sign]
> ../source3/smbd/proto.h:744:7: note: expected ‘char *’ but argument is of type ‘uint8_t *’
> ../source3/smbd/reply.c:4948:6: warning: the address of ‘encrypt’ will always evaluate as ‘true’ [-Waddress]
> 
> This looks like your recent code:
> 
> 3e9f58be (Volker Lendecke             2012-07-17 22:24:51 +0200 4946)   }
> 3e9f58be (Volker Lendecke             2012-07-17 22:24:51 +0200 4947)   if (!srv_send_smb(smbreq->sconn, smbreq->outbuf, true,
> 3e9f58be (Volker Lendecke             2012-07-17 22:24:51 +0200 4948)                     smbreq->seqnum+1, encrypt, NULL)) {
> 3e9f58be (Volker Lendecke             2012-07-17 22:24:51 +0200 4949)           exit_server_cleanly("handle_aio_read_complete: srv_send_smb "
> 3e9f58be (Volker Lendecke             2012-07-17 22:24:51 +0200 4950)                               "failed.");
> 3e9f58be (Volker Lendecke             2012-07-17 22:24:51 +0200 4951)   }
> 3e9f58be (Volker Lendecke             2012-07-17 22:24:51 +0200 4952)   TALLOC_FREE(smbreq);
> 
> That is, there is no local variable encrypt, so it must be finding some
> function or pointer by that name somewhere. 

This patch should help ensure this can't happen again.  We should
probably do something similar for any other rare warnings that we are
currently clear of. 

ADD_CFLAGS tests each flag individually, so it's safe to just put new
gcc options in there. 

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-build-Add-Werror-address-to-the-developer-build.patch
Type: text/x-patch
Size: 1304 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120723/b4a047ef/attachment.bin>


More information about the samba-technical mailing list