IRIX cc fixes for Samba 3.2.0

Jim Brown jim.brown at miami.edu
Tue Jul 1 21:37:04 GMT 2008


There are three source files that compare unsigned values with 0.
The is one source file with an invalid format in a DEBUG message.
Here are the patches for all four problems.

1. lib/replace/strptime.c: get_number and get_alt_number macros.
   This is cosmetic since there is a matching upper limit check (this
removes many compiler warnings).
2. lib/smbconf/smbconf_util.c: the decrementing loop variable is always
non-negative.
   This is an error.
3. libsmb/clientgen.c: the return code in 'len' is always non-negative.
   This is an error.
4. smbd/oplock_irix.c: Invalid format: '5s' instead of '%s' in DEBUG level 5
macro.
   This is an error.

Jim Brown

diff -c lib/replace/strptime.c.orig lib/replace/strptime.c
*** lib/replace/strptime.c.orig Thu Jul  3 05:54:22 2008
--- lib/replace/strptime.c      Thu Jul  3 05:54:41 2008
***************
*** 253,259 ****
  {
    const char *rp_backup;
    int cnt;
!   size_t val;
    int have_I, is_pm;
    int century, want_century;
    int want_era;
--- 253,259 ----
  {
    const char *rp_backup;
    int cnt;
!   ssize_t val;
    int have_I, is_pm;
    int century, want_century;
    int want_era;

diff -c lib/smbconf/smbconf_util.c.orig lib/smbconf/smbconf_util.c
*** lib/smbconf/smbconf_util.c.orig     Thu Jul  3 05:56:14 2008
--- lib/smbconf/smbconf_util.c  Thu Jul  3 05:57:10 2008
***************
*** 132,138 ****
  bool smbconf_reverse_find_in_array(const char *string, char **list,
                                   uint32_t num_entries, uint32_t *entry)
  {
!       uint32_t i;

        if ((string == NULL) || (list == NULL) || (num_entries == 0)) {
                return false;
--- 132,138 ----
  bool smbconf_reverse_find_in_array(const char *string, char **list,
                                   uint32_t num_entries, uint32_t *entry)
  {
!       int32_t i;

        if ((string == NULL) || (list == NULL) || (num_entries == 0)) {
                return false;

diff -c libsmb/clientgen.c.orig libsmb/clientgen.c
*** libsmb/clientgen.c.orig     Thu Jul  3 05:57:46 2008
--- libsmb/clientgen.c  Thu Jul  3 06:07:05 2008
***************
*** 97,103 ****
                        return -1;
                }

!               if (len < 0) {
                        return len;
                }

--- 97,103 ----
                        return -1;
                }

!               if ((ssize_t)len < 0) {
                        return len;
                }

diff -c smbd/oplock_irix.c.orig smbd/oplock_irix.c
*** smbd/oplock_irix.c.orig     Thu Jul  3 06:24:23 2008
--- smbd/oplock_irix.c  Thu Jul  3 06:25:17 2008
***************
*** 184,190 ****
                                 strerror(errno) ));
                } else {
                        DEBUG(5,("irix_set_kernel_oplock: Refused oplock on
"
!                                "file %s, fd = %d, file_id = 5s, "
                                 "gen_id = %ul. Another process had the file
"
                                 "open.\n",
                                 fsp->fsp_name, fsp->fh->fd,
--- 184,190 ----
                                 strerror(errno) ));
                } else {
                        DEBUG(5,("irix_set_kernel_oplock: Refused oplock on
"
!                                "file %s, fd = %d, file_id = %s, "
                                 "gen_id = %ul. Another process had the file
"
                                 "open.\n",
                                 fsp->fsp_name, fsp->fh->fd,





More information about the samba-technical mailing list