Thread overview | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 14, 2005 -wc is too good | ||||
---|---|---|---|---|
| ||||
Walter
I know I was the one who asked for it, but it's _too_ effective. Or, at least, is there a suppression pragma, and, if so, can you arrange to have that specified in the DMC++ header files?
<G>
--
Matthew Wilson
Author: "Imperfect C++", Addison-Wesley, 2004
(http://www.imperfectcplusplus.com)
Contributing editor, C/C++ Users Journal
(http://www.synesis.com.au/articles.html#columns)
STLSoft moderator
(http://www.stlsoft.org)
"I can't sleep nights till I found out who hurled what ball through what apparatus" -- Dr Niles Crane
-------------------------------------------------------------------------------
|
February 25, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cuppnc$84h$1@digitaldaemon.com... > Walter > > I know I was the one who asked for it, but it's _too_ effective. Or, at least, is there a suppression pragma, and, if so, can you arrange to have that specified in the DMC++ header files? > > <G> Suppression pragmas? Uggh. <g> |
February 25, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <newshound@digitalmars.com> wrote in message news:cvmcdp$2qt3$1@digitaldaemon.com... > > "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cuppnc$84h$1@digitaldaemon.com... >> Walter >> >> I know I was the one who asked for it, but it's _too_ effective. Or, >> at >> least, is there a suppression pragma, and, if so, can you arrange to >> have that specified in the DMC++ header files? >> >> <G> > > Suppression pragmas? Uggh. <g> So what's the answer? |
February 27, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvmgdk$2ut2$1@digitaldaemon.com... > > "Walter" <newshound@digitalmars.com> wrote in message news:cvmcdp$2qt3$1@digitaldaemon.com... > > > > "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cuppnc$84h$1@digitaldaemon.com... > >> Walter > >> > >> I know I was the one who asked for it, but it's _too_ effective. Or, > >> at > >> least, is there a suppression pragma, and, if so, can you arrange to > >> have that specified in the DMC++ header files? > >> > >> <G> > > > > Suppression pragmas? Uggh. <g> > > So what's the answer? I'd rather not. Switches to turn warnings on, pragmas to turn them off - I don't think there's much to be gained here that's worth the complexity. |
February 27, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <newshound@digitalmars.com> wrote in message news:cvt8q3$mra$1@digitaldaemon.com... > > "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvmgdk$2ut2$1@digitaldaemon.com... >> >> "Walter" <newshound@digitalmars.com> wrote in message news:cvmcdp$2qt3$1@digitaldaemon.com... >> > >> > "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cuppnc$84h$1@digitaldaemon.com... >> >> Walter >> >> >> >> I know I was the one who asked for it, but it's _too_ effective. >> >> Or, >> >> at >> >> least, is there a suppression pragma, and, if so, can you arrange >> >> to >> >> have that specified in the DMC++ header files? >> >> >> >> <G> >> > >> > Suppression pragmas? Uggh. <g> >> >> So what's the answer? > > I'd rather not. Switches to turn warnings on, pragmas to turn them > off - I > don't think there's much to be gained here that's worth the > complexity. Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them? |
February 28, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com... > > I'd rather not. Switches to turn warnings on, pragmas to turn them > > off - I > > don't think there's much to be gained here that's worth the > > complexity. > > Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them? Sure. |
February 28, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Cool. I'll stick it on the to-do. ;) "Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com... > > "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com... >> > I'd rather not. Switches to turn warnings on, pragmas to turn them >> > off - I >> > don't think there's much to be gained here that's worth the >> > complexity. >> >> Ok. The alternative is to fix the C-style casts in the DMC++ headers. >> Are you amenable to adopting fixes, should I be motivated, from time >> to >> time, to detect and effect them? > > Sure. > > |
March 24, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | string.h, lines 312-324 inline const char *strchr(const char *s, int n) { return strchr(const_cast<char*>(s), n); } inline const char *strrchr(const char *s, int n) { return strrchr(const_cast<char*>(s), n); } inline const char *strpbrk(const char *s1,const char *s2) { return strpbrk(const_cast<char*>(s1), s2); } inline const char *strstr(const char *s1,const char *s2) { return strstr(const_cast<char*>(s1), s2); } inline const void *memchr(const void *s, int c, size_t n) { return memchr(const_cast<void*>(s), c, n); } #ifndef __WCS_INLINE #define __WCS_INLINE inline const wchar_t *wcschr(const wchar_t *s, wchar_t c) { return wcschr(const_cast<wchar_t*>(s), c); } inline const wchar_t *wcsrchr(const wchar_t *s, wchar_t c) { return wcsrchr(const_cast<wchar_t*>(s), c); } inline const wchar_t *wcspbrk(const wchar_t *s1,const wchar_t *s2) { return wcspbrk(const_cast<wchar_t*>(s1), s2); } inline const wchar_t *wcswcs(const wchar_t *s1,const wchar_t *s2) { return wcswcs(const_cast<wchar_t*>(s1), s2); } inline const void *wmemchr(const void *s, wchar_t c, size_t n) { return wmemchr(const_cast<void*>(s), c, n); } Note: the strpbrk/wcspbrk were actually wrong. They were: inline const char *strpbrk(const char *s1,const char *s2) { return (char *) strpbrk((const char *)s1,s2); } inline const wchar_t *wcspbrk(const wchar_t *s1,const wchar_t *s2) { return (wchar_t *) wcspbrk((const wchar_t *)s1,s2); } The cast on the return type is not necessary, but benign. The incorrect cast on the s1 argument looks like it'd result in a nasty stack exhaustion. ;) The following test program produces correct behaviour when used with the modified string.h, and just dies in the strpbrk() call in the original (i.e. we never see "Exiting" or "Something bad happened" or "s: uff") //#include <string.h.old> #include <string.h> #include <stdio.h> int main() { try { const char stuff[] = "stuff"; printf("Calling strpbrk()\n"); char const *s = strpbrk(stuff, "fu"); printf("s: %s\n", s); return 0; } catch(...) { printf("Something bad happened\n"); return 1; } printf("Exiting\n"); return 0; } "Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com... > > "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com... >> > I'd rather not. Switches to turn warnings on, pragmas to turn them >> > off - I >> > don't think there's much to be gained here that's worth the >> > complexity. >> >> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them? > > Sure. > > |
March 24, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | stlport/stl/_algobase.h Lines 159-150 (static_cast<char*>(memmove(__result, __first, (static_cast<char const*>(__last) - static_cast<char const*>(__first))))) + (static_cast<char const*>(__last) - static_cast<char const*>(__first)); Lines 183-184 const ptrdiff_t _Num = static_cast<char const*>(__last) - static_cast<char const*>(__first); return (_Num > 0) ? memmove(static_cast<char*>(__result) - _Num, __first, _Num) : __result ; |
March 24, 2005 Re: -wc is too good | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | stlport/stl/_uninitialized.h Line 84: return static_cast<char*>(__copy_trivial (__first, __last, __result)); Line 90: return static_cast<wchar_t*>(__copy_trivial (__first, __last, __result)); "Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com... > > "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com... >> > I'd rather not. Switches to turn warnings on, pragmas to turn them >> > off - I >> > don't think there's much to be gained here that's worth the >> > complexity. >> >> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them? > > Sure. > > |
Copyright © 1999-2021 by the D Language Foundation