Closed Bug 446229 Opened 16 years ago Closed 16 years ago

SM: fixing GCC conversion warnings

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

Details

(Keywords: perf)

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #441686 +++

Currently when compiling SM sources under GCC 4.2 woth -Wconversion enabled (browser builds) the compiler generates warnings like:

NULL used in arithmetic
converting to non-pointer type ‘long int’ from NULL
deprecated conversion from string constant to ‘char*’

It would be nice to fix this.
Status: NEW → ASSIGNED
No longer depends on: 441686
Attached patch v1Splinter Review
To make things clear instead of changing the code like in:

-        STOBJ_SET_PARENT(FUN_OBJECT(fun), NULL);
+        STOBJ_SET_PARENT(FUN_OBJECT(fun), 0);

I added *OBJ_CLEAR_(PROTO|PARENT) functions with usage like in:

-        STOBJ_SET_PARENT(FUN_OBJECT(fun), NULL);
+        STOBJ_CLEAR_PARENT(FUN_OBJECT(fun));

An alternative is to name the functions *OBJ_NULL_(PROTO|PARENT), but that may not sound good.
Attachment #330430 - Flags: review?(brendan)
Comment on attachment 330430 [details] [diff] [review]
v1

Great, thanks!

/be
Attachment #330430 - Flags: review?(brendan) → review+
fixed - http://hg.mozilla.org/mozilla-central/index.cgi/rev/f2b76fc67c3b
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: