Closed Bug 155852 Opened 23 years ago Closed 23 years ago

gcc 3.1 compile warnings from #including new.h

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

References

Details

Attachments

(1 file, 3 obsolete files)

gcc 3.1 gives several of these types of warnings when building Mozilla: In file included from /usr/include/g++-v3/backward/new.h:33, from ../../../../dist/include/string/nsBufferHandleUtils.h:36, from ../../../../dist/include/string/nsSharableString.h:35, from ../../../../dist/include/string/nsPromiseFlatString.h:28, from ../../../../dist/include/string/nsString2.h:70, from ../../../../dist/include/string/nsString.h:54, from ../../../../../js/src/xpconnect/src/xpcprivate.h:84, from ../../../../../js/src/xpconnect/src/xpccallcontext.cpp:38:/usr/include/g++-v3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated. So, we need to change <new.h> to <new> to get rid of this. There are 17 places in the codebase where we #include <new.h>. My primary concern about just changing it is, of course, that platforms will break. Are there any compilers that we support which don't support #include <new>?
Only tested on gcc 3.1 on Linux so far.
This also builds fine on Mac CFM, Mac Mach-O, and RedHat 6.2 (egcs 1.1.2).
It also builds on Windows (MSVC 6.0) and Solaris (Sun Workshop 6).
Basically, every platform except IRIX seems to support this (I just tested HP-UX and True64 as well). So, we could: 1. drop IRIX support 2. require IRIX users to install some supplemental package that provides these headers (or even a script to generate them) 3. autoconf the <new> test, perhaps providing a macro so that you can do #include <NEW_H>
Status: NEW → ASSIGNED
Chris, any thoughts on this?
Antitux, can you check with your SGI contacts and see if we can get any compiler upgrades which would address this problem? Bryner, did you check AIX as well? The macro seems like the lesser of the evila so I guess we should go with that and wait for non-standard compilers to fade away.
I didn't check AIX because I didn't see it on either the main tbox page or the ports page.
Hrm, good point. Pinging jdunn as I didn't think that we dropped AIX support.
We didn't drop AIX support, just don't have a tbox. :-( I am adding Phil since I don't have an AIX box handy to try this out on. (I am assuming however that AIX/xlC is happy with "#include <new>" Irix contact should/might be Richard Hess <rhess@engr.sgi.com>
mkaply tells me that OS/2 VACPP also doesn't like <new>.
AIX works fine with <new> instead of <new.h>. We have a Tinderbox up and running within IBM for AIX, but currently it is on the MozillaTest tree. I hope to move it to SeamonkeyPorts sometime in the next couple of days.
Ok, so what do we want to do here? We apparently can't just make the substitution because of IRIX and OS/2. Should we do a configure test and macro?
bryner: that sounds to me like the most reasonable course of action.
One question wrt implementation: Do we want to completely hide the details from the developers and use -DNEW_H=new (and possibly -DSSTREAM_H=sstream) or do we want to set some define (-DREQUIRES_DEPRECATED_CPP_HEADERS) and require the developers to ifdef accordingly?
Attachment #90341 - Attachment is obsolete: true
Attached patch patch #2 (obsolete) — Splinter Review
Fixed the Mac definition of NEW_H.
Attachment #95738 - Attachment is obsolete: true
Attached patch patch #3Splinter Review
Define NEW_H to <new> for Windows, where we skip the normal header checks.
Attachment #95813 - Attachment is obsolete: true
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
There are similar problems with #include <iostream.h>: http://lxr.mozilla.org/seamonkey/search?string=iostream.h
This caused bug 311923
Depends on: 311923
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: