cast from void * to char breaks hpux, aix & OS/2

VERIFIED FIXED

Status

MailNews Core
Networking: POP
--
critical
VERIFIED FIXED
17 years ago
9 years ago

People

(Reporter: cls, Assigned: Navin Gupta)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
Naving, your checkin of net_pop3_remove_messages_marked_delete() in
nsPop3Protocol.cpp caused 3 of our ports tinderboxes to go red tonight.  The
error messages were along the lines of:

"/builds/tinderbox/SeaMonkey/AIX_4.3_Clobber/mozilla/mailnews/local/src/nsPop3Protocol.cpp",
line 114.35: 1540-225: (S) "char" is too small to hold a value of type "void*".

I made the following change to the code in hopes of making the trees turn green
again but there's an ongoing debate on #mozilla as to whether either the fix or
the original code would 

Here's the core of my change.

-
char valueChar = (char) he->value;
+
char valueChar = '\0';
+    if (he->value)
+
  nsCRT::memcpy(&valueChar, he->value, sizeof(char));
do what was desired since sizeof char != sizeof void *.
(Assignee)

Comment 1

17 years ago
Thanks for fixing the bustage
(Reporter)

Comment 2

17 years ago
Oops, I meant to update this before I went to bed last night.  Turns out that my
controversial fix was the wrong thing to do after all.  We ended up using Brad
Roberts' fix of replacing

char valueChar = (char) he->value;

with

char valueChar = (char)(long)he->value;

Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 3

17 years ago
Navin, please verify this
(Assignee)

Comment 4

17 years ago
verified
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.