[Dev-C++] Re: Dev-cpp-users digest, Vol 1 #1429 - 9 msgs
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: jp <rar...@xt...> - 2003-04-26 08:12:06
|
how come u only can come for 1.500000 days? ----- Original Message ----- From: <dev...@li...> To: <dev...@li...> Sent: Saturday, April 26, 2003 3:04 PM Subject: Dev-cpp-users digest, Vol 1 #1429 - 9 msgs > Send Dev-cpp-users mailing list submissions to > dev...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > or, via email, send a message with subject or body 'help' to > dev...@li... > > You can reach the person managing the list at > dev...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Dev-cpp-users digest..." > > > Today's Topics: > > 1. RE: is the preprocessor considered harmful? (Pierre Raoul) > 2. RE: stdin reset... (Ioannis Vranos) > 3. RE: missing ";" (Ioannis Vranos) > 4. Re[2]: [Dev-C++] stdin reset... (=?ISO-8859-7?B?Q2hyaXN0aWFuIFNjaORmZXI=?=) > 5. Re: General question / remark (David Matthews) > 6. RES: Re[2]: [Dev-C++] stdin reset... (Daniel K. O.) > 7. RES: [Dev-C++] General question / remark (Daniel K. O.) > 8. Kip Warner leaves the project (Colin Laplace) > 9. RE: Re[2]: [Dev-C++] stdin reset... (Ioannis Vranos) > > --__--__-- > > Message: 1 > From: "Pierre Raoul" <pie...@wa...> > To: "Sourceforge. Net Dev-Cpp-Users@Lists." <dev...@li...> > Subject: RE: [Dev-C++] is the preprocessor considered harmful? > Date: Fri, 25 Apr 2003 22:26:32 +0200 > > > > "jp" <rar...@xt...> on Fri, 25 Apr 2003 07:27:16 +1200 wrote: > > > Hi, > >=20 > > This isn't a Dev-Cpp question, but I'd be interested in anyone's=20 > > thoughts... > >=20 > > If I'm using C++, I avoid using the preprocessor for anything except > > #include's and #pragma's. > >=20 > > The directives I most despise are #line, as suffered by users of = > lex/yacc, > > esql, and other source code generators, and ... > >=20 > > #ifdef ENTIRELY_STUPID_FEATURE_FOR_ANNOYING_CLIENT > > void stupid(); > > #endif > >=20 > > If I need a constant I use, eg, enum{SOMETHING=3D0xffffffff}; One of = > the > > benefits is that such constants are scoped. It bugs me when I want, = > eg, > > enum{ERROR=3D0xffffffff}; and ERROR has already been #defined in a = > header... > > Sometimes, wash my mouth out, I #undef, eg, ERROR.. > >=20 > > If I need a macro I use... > > template <typename someT> void xargle( someT& thing) > > { > > xargle_buffer << thing; > > } > >=20 > > BUT, and here's the point of my question, I don't know of any way to > > stringize or token paste without using the preprocessor. I have=20 > > a lisp. Not > > literally, like thith, but a library I've written. Built in types are > > instantiated using templates, so that, given a constant type id (eg: > > INTEGER), I can add a new type like so.. > >=20 > > DECLTYPE(int, INTEGER, Integer) > >=20 > > the macro DECLTYPE looks like this... > >=20 > > #define DECLTYPE(T, I, n)typedef imp::ImplObject<T, I> n;\ > > bool is##n(const Object &obj);\ > > const T &get##n(const Object &obj);\ > > T &ref##n(const Object &obj); > >=20 > > and there is an equally brief IMPLTYPE. > > The library allows constructions like.. > >=20 > > Object thing =3D String("gimme five: "); > > String s =3D thing; > > Integer i =3D 4; > > thing =3D i; > >=20 > > refInteger(thing)++; > > cout << s << thing; > >=20 > > = > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > This all works pretty well, and my lisp handles multimedia, ISAM, COM, > > sockets and other exotica in a fully object oriented, but=20 > > typesafe, manner. > > But FUNGLTYPE is a macro, and like I say, #define's are for grannies, = > so.. > > ..does anybody know of an alternative to macros for generating = > identifiers > > from user supplied fragments? > >=20 > > Cheers, > > jp. > > I'm not sure to fully understand your need, but may be you can get some = > ideas here: > > Chap. 3 "Typelists", Modern C++ Design, Andrei Alexandrescu, Addison = > Wesley ed. > > or else: > > http://www.cuj.com/experts/2002/alexandr.htm?topic=3Dexperts > > http://www.research.ibm.com/designpatterns/pubs/ph-jun00.pdf > > with the loki library here: > > http://sourceforge.net/projects/loki-lib/ > > Regards > > Pierre Raoul > > > > --__--__-- > > Message: 2 > From: "Ioannis Vranos" <iv...@at...> > To: <dev...@li...> > Subject: RE: [Dev-C++] stdin reset... > Date: Fri, 25 Apr 2003 23:33:16 +0300 > > > -----Original Message----- > > From: dev...@li...=20 > > [mailto:dev...@li...] On Behalf=20 > > Of Christian Sch=E4fer > > Sent: Friday, April 25, 2003 3:30 PM > > To: dev...@li... > > Subject: Re: [Dev-C++] stdin reset... > >=20 > >=20 > > > -stdin gets cleared > > > how can i do that? > >=20 > > fflush(stdin); > >=20 > > just found out how.. thanks anyway! > > > Which is not safe. getchar(), fgets(), etc, should be used instead, > > > > > Ioannis Vranos > =20 > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > --__--__-- > > Message: 3 > From: "Ioannis Vranos" <iv...@at...> > To: "Dev-C++ Mailing List" <dev...@li...> > Subject: RE: [Dev-C++] missing ";" > Date: Fri, 25 Apr 2003 23:36:08 +0300 > > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of Neszt Tibor > > Sent: Friday, April 25, 2003 4:23 PM > > To: Daniel Glenfield > > Cc: dev...@li... > > Subject: Re: [Dev-C++] missing ";" > > > > > > > ok let's find out a few things. If you open notepad or > > another text editor > > > can you type a semi colon? If you can, you'll need to > > reinstall DEV. If not, > > > you need to reinstall your OS or, if a special keyboard, > > the keyboard > > > driver. > > > > Reinstall OS :-))))) > > > > Oh, funny, You don't understand me. Of course, I can type > > semicolon all of > > my other programs. Need to reintall devc++? How many times? > > If You read > > my letter thoughtfully, You can see, I tried many version of devc++. > > Moreover! In the meantime, I tried to install devc++ to 4 > > other computers, > > and the semicolor is missing on all of them. > > I'm sure the problem is NOT in the devc++. > > I use hungarian keyboard, if it is important. (Any other > > hungarian user > > here?) > > > > Regards, > > > > Neszt Tibor > > > > P.s.: To see, I can type semicolon here... ;;;;;;;;;;; > > > Then you can add the English (American) keyboard langage with keyboard > layout US, and use it to write your code. > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > --__--__-- > > Message: 4 > Date: Fri, 25 Apr 2003 22:55:15 +0200 > From: =?ISO-8859-7?B?Q2hyaXN0aWFuIFNjaORmZXI=?= <ca...@kr...> > Reply-To: =?ISO-8859-7?B?Q2hyaXN0aWFuIFNjaORmZXI=?= <ca...@kr...> > To: dev...@li..., "Ioannis Vranos" <iv...@at...> > CC: dev...@li... > Subject: Re[2]: [Dev-C++] stdin reset... > > hi Ioannis, > > >> > -stdin gets cleared > >> > how can i do that? > >> > >> fflush(stdin); > > Which is not safe. getchar(), fgets(), etc, should be used instead, > > and why is that? > I am very interested in code security issues but at least i want to > understand instead of obey them. so what exactly is considered > 'unsafe'? > > what I need is a secure way to read as much as there is from stdin > undtil '\n' into a char* buffer. I want that buffer to match the > needed length (I don't know how to do that, since I don't know the > exact needed length until i read it from stdin...) and I need to avoid > buffer overflows (of course). > I thought scanf() is a good way, since it reads only a specified > number of characters right? (ok, this is just a workaround, I guess..) > > I don't think this is a unique problem so there must be a known way to > solve it, is there? > > gruss > /Christian mailto:ca...@kr... > > --- > > > I propose that the following character sequence for joke markers: > > :-) > > 19-Sep-82 11:44 Scott E Fahlman > > > > --__--__-- > > Message: 5 > Date: Fri, 25 Apr 2003 17:02:02 -0400 > To: Janos Blazi <jb...@gm...>, dev...@li... > From: David Matthews <dem...@uw...> > Subject: Re: [Dev-C++] General question / remark > > Well, gdb is already integrated with Dev-C++. It doesn't have the best > interface, IMHO, so there's also the Insight frontend (available on > www.bloodshed.com/dev/) Of course, it screws up the Dev-C++ 5 betas so you > can't get rid of it. > > At 04:55 PM 25/04/2003 +0200, Janos Blazi wrote: > >After having played with Dec-C++ for a few days, here is what I see: > >The IDE that Dev-C++ is so good that I should probably never use Emacs for > >programming any more. It (Dev-C++) is so much better than MVC++6. > > > >So the only problem (as far as I and probably many other people are > >concerned) is the lack of a decent debugger. I do not know how difficult it > >is to write a MVC++6 style debugger but that debugger is excellent. > >Now I just thought: The Watcom sources should be be free by now; so > >wouldn't it be possible to look at that code and learn how they implemented > >their debugger (which almost paralleled the MVC++ debugger) and write your > >own debugger. Taken the genuine devotion of the Dev-C++ team (othwewise > >they could not have created such a nice product) it would be only a > >question of until they woul produce even a better debugger. > > > >Is this suggestion completely stupid? Is any work being done on a debugger > >vor Dev-C++? > > > >(As for the quality of the compiler, for most applications it is not that > >decisive.) > > > >At the moment I use Dev-C++ and for the tricky parts MVC++6. Anyway, thx > >for this great product. > > > >-- > >EG > > > > > >------------------------------------------------------- > >This sf.net email is sponsored by:ThinkGeek > >Welcome to geek heaven. > >http://thinkgeek.com/sf > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > --__--__-- > > Message: 6 > From: "Daniel K. O." <dan...@ya...> > To: "Christian Schafer" <ca...@kr...>, > <dev...@li...> > Subject: RES: Re[2]: [Dev-C++] stdin reset... > Date: Fri, 25 Apr 2003 18:57:51 -0300 > > > > > >> fflush(stdin); > > > Which is not safe. getchar(), fgets(), etc, should be used instead, > > > > and why is that? > > I am very interested in code security issues but at least i want to > > understand instead of obey them. so what exactly is considered > > 'unsafe'? > > > > The same reason you shouldn't fflush(2.5), fflush("some string") nor > fflush(a, b, c), you shouldn't fflush(stdin); the standard says that > "fflush()" is for output streams; not input streams, not strings, not > anything else; the non-standard way can work on a particular system, but it > can kill some lives on others. > > > > > what I need is a secure way to read as much as there is from stdin > > undtil '\n' into a char* buffer. I want that buffer to match the > > needed length (I don't know how to do that, since I don't know the > > exact needed length until i read it from stdin...) and I need to avoid > > buffer overflows (of course). > > I thought scanf() is a good way, since it reads only a specified > > number of characters right? (ok, this is just a workaround, I guess..) > > > Try fgets(), then sscanf(). > > > > I don't think this is a unique problem so there must be a known way to > > solve it, is there? > > > > > Suggestion (for all you C programmers): > > The comp.lang.c answers to frequently asked questions: > http://www.eskimo.com/~scs/C-faq/top.html > > > > > > > > Daniel K. O. > > > > > > > --__--__-- > > Message: 7 > From: "Daniel K. O." <dan...@ya...> > To: <dev...@li...> > Subject: RES: [Dev-C++] General question / remark > Date: Fri, 25 Apr 2003 19:03:26 -0300 > > > > > -----Mensagem original----- > > De: dev...@li... > > [mailto:dev...@li...]Em nome de David > > Matthews > > Enviada em: sexta-feira, 25 de abril de 2003 18:02 > > Para: Janos Blazi; dev...@li... > > Assunto: Re: [Dev-C++] General question / remark > > > > > > Well, gdb is already integrated with Dev-C++. It doesn't have the best > > interface, IMHO, so there's also the Insight frontend (available on > > www.bloodshed.com/dev/) Of course, it screws up the Dev-C++ 5 > > betas so you > > can't get rid of it. > > > > Just install Insight on another directory, and add it to your Tools menu. > Backing-up your original "gdb.exe" also helps if you want to install Insight > on Dev-C++'s directory. > > > > > > > Daniel K. O. > > > > > > --__--__-- > > Message: 8 > From: Colin Laplace <ha...@bl...> > Reply-To: ha...@bl... > To: dev...@li... > Date: Sat, 26 Apr 2003 01:13:53 +0200 > Subject: [Dev-C++] Kip Warner leaves the project > > Hello, > > Kip Warner, the author and maintener of vUpdate and vRoach tools, has decided > to leave the project. You can view his letter of resignation at : > http://www.zero47.com/html/literature/DevCppResignation.html > > I just wanted to let everybody know. Nothing has been decided yet about the > future of vUpdate, but in all case there will still be an update system for > Dev-C++. > > Greetings, > Colin Laplace > > > > --__--__-- > > Message: 9 > From: "Ioannis Vranos" <iv...@at...> > To: "Dev-C++ Mailing List" <dev...@li...> > Subject: RE: Re[2]: [Dev-C++] stdin reset... > Date: Sat, 26 Apr 2003 04:47:54 +0300 > > > -----Original Message----- > > From: Christian Sch=E4fer [mailto:ca...@kr...]=20 > > Sent: Friday, April 25, 2003 11:55 PM > > To: dev...@li...; Ioannis Vranos > > Cc: dev...@li... > > Subject: Re[2]: [Dev-C++] stdin reset... > >=20 > >=20 > > and why is that? > > I am very interested in code security issues but at least i want to > > understand instead of obey them. so what exactly is considered > > 'unsafe'? > >=20 > > what I need is a secure way to read as much as there is from stdin > > undtil '\n' into a char* buffer. I want that buffer to match the > > needed length (I don't know how to do that, since I don't know the > > exact needed length until i read it from stdin...) and I need to avoid > > buffer overflows (of course). > > I thought scanf() is a good way, since it reads only a specified > > number of characters right? (ok, this is just a workaround, I guess..) > >=20 > > I don't think this is a unique problem so there must be a known way to > > solve it, is there? > > > fflush() is intended for output streams, not input. For example > fflush(stdin); does not work in GNU/Linux. So you can't expect > fflush(stdin); to be portable. You will have to use aither a plain > getchar(); call after a plain scanf() or create a clean function in the > style: > > > void clean_stdin() > { > while(getchar()!=3D'\n') > ; > } > > > > > Ioannis Vranos > =20 > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > > --__--__-- > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > End of Dev-cpp-users Digest |