Bug 6864 - Compile warning in server/conf.c -- cast from pointer to integer of different size
: Compile warning in server/conf.c -- cast from pointer to integer of different...
Status: RESOLVED FIXED
: Replica Location
RLS
: development
: All All
: P3 minor
: ---
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-09-28 13:00 by
Modified: 2009-12-07 16:25 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-09-28 13:00:01
conf.c: In function ‘conf_read’:
conf.c:170: warning: cast from pointer to integer of different size

The problem is very likely that a pointer to a "void" is larger than an "int".

This is the code in question:

    switch (options[i].type) {
      case BOOL:/* Same as INT  */
line 170 ===>
      case INT: *(int *) options[i].val = (int) options[i].defval;
<===
                break;
      case STR: if (*(char **) options[i].val &&
                    *(char **) options[i].val != options[i].defval)
                  globus_libc_free(*(char **) options[i].val);
                *(char **) options[i].val = options[i].defval;
                break;
      default:  break;
    }

This is the definition:

typedef struct {
  char          *name;
  void          *val;
  void          *defval;
  opttypes_t    type;
  int           flags;
#define CF_CMDLINE      0x1
#define CF_DEPRECATED   0x2
#define CF_PRIVATE      0x4
} OPTION;