Closed
Bug 227074
Opened 22 years ago
Closed 22 years ago
nsTraceRefcnt.h should not include stdio.h
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: dbaron)
Details
(Whiteboard: [patch])
Attachments
(1 file, 1 obsolete file)
|
9.85 KB,
patch
|
dougt
:
review+
brendan
:
superreview+
brendan
:
approval1.6+
|
Details | Diff | Splinter Review |
nsTraceRefcnt.h is now part of the SDK (and should be working; see bug 226555).
It includes <stdio.h>. If we want to remove that, it would be better to do it
now rather than once SDK users start depending on our headers bringing in
stdio.h. It should also speed up compilation a bit.
(This was needed in the old nsTraceRefcnt.h before the glue/base split, since it
had FILE* parameters for some functions, but it's not needed now.)
| Assignee | ||
Comment 1•22 years ago
|
||
It's not going to speed up compilation much since nsString2.h includes stdio.h
as well, so anyone including the unfrozen string classes by nsString.h /
nsString2.h will get stdio.h as well. This also makes it much easier to fix,
since fewer includes need to be added...
Comment 2•22 years ago
|
||
One way to avoid over-including stdio.h is to depend on the FILE macro (which is
always a macro, AFAICT -- but probably the standard does not require it to be a
macro rather than a typedef), and bracket uses of FILE with #ifdef FILE, so that
callers wanting the FILE-dependent declarations to be visible must include
stdio.h themselves, first.
Cc'ing darin, who has a plan for strings. We should get some bugs on file there.
/be
| Assignee | ||
Comment 3•22 years ago
|
||
I don't think the string headers actually *need* to include stdio.h for any
reason. They just do...
| Assignee | ||
Comment 4•22 years ago
|
||
This is what I needed to compile with the include removed. I should probably
test on another platform, although I could just let tinderbox tell me...
Comment 5•22 years ago
|
||
Comment on attachment 136506 [details] [diff] [review]
patch
Any reason not to include <> headers before "" ones? That is standard
operating procedure where I come from. It would also match, e.g., the location
of the <stdlib.h> include in the first file in the patch.
/be
| Assignee | ||
Updated•22 years ago
|
Whiteboard: [patch]
| Assignee | ||
Comment 6•22 years ago
|
||
Attachment #136506 -
Attachment is obsolete: true
| Assignee | ||
Updated•22 years ago
|
Attachment #137261 -
Flags: review?(dougt)
Updated•22 years ago
|
Attachment #137261 -
Flags: review?(dougt) → review+
| Assignee | ||
Comment 7•22 years ago
|
||
Comment on attachment 137261 [details] [diff] [review]
patch
I want to get this in so external users of this header don't depend on it
including stdio.h.
Attachment #137261 -
Flags: superreview?(brendan)
Attachment #137261 -
Flags: approval1.6?
Comment 8•22 years ago
|
||
Comment on attachment 137261 [details] [diff] [review]
patch
Sure, Asa agrees with safe code-level fixes and hygiene improvements like this
being shotgunned in. BLAM!
/be
Attachment #137261 -
Flags: superreview?(brendan)
Attachment #137261 -
Flags: superreview+
Attachment #137261 -
Flags: approval1.6?
Attachment #137261 -
Flags: approval1.6+
| Assignee | ||
Comment 9•22 years ago
|
||
Fix checked in to trunk, 2003-12-12 15:02 -0800.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•