Closed Bug 486774 Opened 11 years ago Closed 5 years ago

Quell compiler warning on SunPro CC in addition to GCC

Categories

(Core :: JavaScript Engine, defect, minor)

Sun
Solaris
defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: andrew, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file, 2 obsolete files)

Currently, code checks for GCC to initialize variables to NULL to prevent a compiler warning. SunPro CC also emits warnings, so the #ifdef should be extended to cover that compiler as well.

I'd vote that rather than adding more #ifdef noise, the variables just always be initialized to NULL. I'll attach patches for both options and leave it up to the reviewer.
Attachment #370973 - Flags: review?(brendan)
Attachment #370975 - Flags: review?(brendan)
Attachment #370973 - Flags: review?(brendan) → review+
Comment on attachment 370973 [details] [diff] [review]
patch to extend existing #ifdef logic to cover __SUNPRO_CC

Not brendan but this looks harmless.
Attachment #370975 - Flags: review?(brendan) → review+
Comment on attachment 370975 [details] [diff] [review]
patch to remove #ifdefs completely and initialize vars to NULL

I am fine with either. Any compiler worth a penny will eliminate the redundant NULL writes.
Attachment #370975 - Flags: review?(brendan.eich)
Blocks: buildwarning
Whiteboard: [build_warning]
Rebased old patch, simply initialize the two stack vars to NULL to get rid of ugly __GNUC__ ifdef since other compilers complain too.
Attachment #370973 - Attachment is obsolete: true
Attachment #370975 - Attachment is obsolete: true
Attachment #569265 - Flags: review?(gal)
Attachment #370975 - Flags: review?(brendan.eich)
Comment on attachment 569265 [details] [diff] [review]
Always initialize two stack variables instead of only when using g++.

Assuming this doesn't apply at this point. Feel free to r? me for it if it still works and you want it.
Attachment #569265 - Flags: review?(gal)
Assignee: general → nobody
Code is obsolete now.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.