Bug 3875 - locking/locking.c: "void (*)(struct share_mode_entry *, const char *, const char *)"
locking/locking.c: "void (*)(struct share_mode_entry *, const char *, const c...
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.23
SGI IRIX
: P3 normal
: none
Assigned To: Tim Potter
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-27 11:21 UTC by Jason Mader
Modified: 2006-06-28 17:33 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mader 2006-06-27 11:21:43 UTC
--- locking/locking.o ---
cc-1140 c99: WARNING File = locking/locking.c, Line = 1277
  A value of type "void *" cannot be used to initialize an entity of type
          "void (*)(struct share_mode_entry *, const char *, const char *)".

        void (*traverse_callback)(struct share_mode_entry *, const char *, const char *) = state;
                                                                                           ^
Comment 1 Jason Mader 2006-06-27 12:34:42 UTC
from brlock.c:

BRLOCK_FN(traverse_callback) = (BRLOCK_FN_CAST())state;

#define BRLOCK_FN_CAST() \
        void (*)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \
                                 enum brl_type lock_type, \
                                 enum brl_flavour lock_flav, \
                                 br_off start, br_off size)

#define BRLOCK_FN(fn) \
        void (*fn)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \
                                 enum brl_type lock_type, \
                                 enum brl_flavour lock_flav, \
                                 br_off start, br_off size)
Comment 2 Jason Mader 2006-06-27 12:38:53 UTC
I extrapolated that to (in include/smb.h):

#define LOCKING_FN_CAST() \
        void (*)(struct share_mode_entry *, const char *, const char *)

#define LOCKING_FN(fn) \
        void (*fn)(struct share_mode_entry *, const char *, const char *)

and changed the assignment to,

LOCKING_FN(traverse_callback) = (LOCKING_FN_CAST())state;
Comment 3 Jeremy Allison 2006-06-28 17:33:22 UTC
Applied that fix - thanks a lot !
Jeremy.