compiler found an error in handle_aio_read_complete

Jeremy Allison jra at samba.org
Mon Jul 23 15:14:50 MDT 2012


On Mon, Jul 23, 2012 at 07:27:29PM +1000, Andrew Bartlett wrote:
> 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. 

Pushed this to master - thanks !


More information about the samba-technical mailing list