Closed
Bug 444296
Opened 17 years ago
Closed 17 years ago
smbase -- depreciate the used of <ostream.h>
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: segg2, Unassigned)
References
Details
Attachments
(3 files, 2 obsolete files)
9.23 KB,
patch
|
Details | Diff | Splinter Review | |
1.68 KB,
patch
|
Details | Diff | Splinter Review | |
7.17 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061712 Fedora/3.0-1.fc9 Firefox/3.0
Build Identifier: smbase current
implementation of c++ compiler now conform to standard.
and name in std libraries required "using namespace std;" declaration.
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Reporter | ||
Comment 1•17 years ago
|
||
Comment 2•17 years ago
|
||
Comment on attachment 328642 [details] [diff] [review]
diff file of the smbasee directory
> #include <string.h> // strlen, strcpy
>-#include <iostream.h> // clog
>+//#include <iostream.h> // clog
Please delete lines instead of commenting them out
>-#include <iostream.h> // ostream
>+#if defined(__GNUC__) && __GNUC__ < 4
>+# include <iostream.h> // ostream
>+#else
>+# include <iostream>
>+#endif
Don't worry about ifdefing these, just delete the .h part
Please resubmit patches with that cleaned up.
Reporter | ||
Comment 3•17 years ago
|
||
(In reply to comment #2)
> Don't worry about ifdefing these, just delete the .h part
>
> Please resubmit patches with that cleaned up.
resubmitting with the corrections
Reporter | ||
Comment 4•17 years ago
|
||
Attachment #328642 -
Attachment is obsolete: true
Comment 5•17 years ago
|
||
Comment on attachment 328821 [details] [diff] [review]
diff file of the smbase directory
>
> // ------------------ BitwiseGrowArray --------------------
>@@ -121,19 +121,19 @@
>
> // shallow copy data from src to dest
> static void copy(T *dest, T *src, size_t count) {
>- memcpy(dest, src, sizeof(T)*count);
>+ ::memcpy(dest, src, sizeof(T)*count);
> }
>
> // uninitialized alloc
> static T *alloc(size_t count) {
>- void *m = malloc(sizeof(T)*count);
>- if (!m) throw bad_alloc();
>+ void *m = ::malloc(sizeof(T)*count);
>+ if (!m) throw std::bad_alloc();
> return (T*) m;
> }
>
> // dealloc
> static void dealloc(T *ary) {
>- free(ary);
>+ ::free(ary);
> }
> };
>
Is most of this really needed to compile?
Comment 6•17 years ago
|
||
also, since these files aren't headers. Wouldn't it make more sense to just put using namespace std on top?
Comment 7•17 years ago
|
||
nevermind, i guess the whole problem is that you can't do using namespace std;
Comment 8•17 years ago
|
||
Hey Gilles,
I'm still on this. I think I want to work on the renaming tool so I can rename elsa's string class and do using namespace std; in .cpp files.
This way the code is a good testcase for it.
if you like I can compromise and commit .h changes now and you can maintain .cpp changes in your own patch queue for now. I don't think it'll take too long to do the rename.
Reporter | ||
Comment 9•17 years ago
|
||
Attachment #328821 -
Attachment is obsolete: true
Reporter | ||
Comment 10•17 years ago
|
||
should not depend on #331412 attachment.
Reporter | ||
Comment 11•17 years ago
|
||
Comment 12•17 years ago
|
||
thanks, pushed
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•