Closed
Bug 155852
Opened 23 years ago
Closed 23 years ago
gcc 3.1 compile warnings from #including new.h
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bryner, Assigned: bryner)
References
Details
Attachments
(1 file, 3 obsolete files)
|
6.45 KB,
patch
|
netscape
:
review+
|
Details | Diff | Splinter Review |
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>?
| Assignee | ||
Comment 1•23 years ago
|
||
Only tested on gcc 3.1 on Linux so far.
| Assignee | ||
Comment 2•23 years ago
|
||
This also builds fine on Mac CFM, Mac Mach-O, and RedHat 6.2 (egcs 1.1.2).
| Assignee | ||
Comment 3•23 years ago
|
||
It also builds on Windows (MSVC 6.0) and Solaris (Sun Workshop 6).
| Assignee | ||
Comment 4•23 years ago
|
||
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
| Assignee | ||
Comment 5•23 years ago
|
||
Chris, any thoughts on this?
Comment 6•23 years ago
|
||
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.
| Assignee | ||
Comment 7•23 years ago
|
||
I didn't check AIX because I didn't see it on either the main tbox page or the
ports page.
Comment 8•23 years ago
|
||
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>
| Assignee | ||
Comment 10•23 years ago
|
||
mkaply tells me that OS/2 VACPP also doesn't like <new>.
Comment 11•23 years ago
|
||
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.
| Assignee | ||
Comment 12•23 years ago
|
||
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?
Comment 13•23 years ago
|
||
bryner: that sounds to me like the most reasonable course of action.
Comment 14•23 years ago
|
||
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?
| Assignee | ||
Comment 15•23 years ago
|
||
Attachment #90341 -
Attachment is obsolete: true
| Assignee | ||
Comment 16•23 years ago
|
||
Fixed the Mac definition of NEW_H.
Attachment #95738 -
Attachment is obsolete: true
| Assignee | ||
Comment 17•23 years ago
|
||
Define NEW_H to <new> for Windows, where we skip the normal header checks.
Attachment #95813 -
Attachment is obsolete: true
Comment 18•23 years ago
|
||
Comment on attachment 95815 [details] [diff] [review]
patch #3
r=cls
Attachment #95815 -
Flags: review+
| Assignee | ||
Comment 19•23 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 20•23 years ago
|
||
There are similar problems with #include <iostream.h>:
http://lxr.mozilla.org/seamonkey/search?string=iostream.h
You need to log in
before you can comment on or make changes to this bug.
Description
•