home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!hagbard!loglule!jbn
- From: jbn@lulea.trab.se (Johan Bengtsson)
- Newsgroups: comp.lang.c++
- Subject: Re: Give me safe C++
- Message-ID: <5439@holden.lulea.trab.se>
- Date: 16 Dec 92 17:22:06 GMT
- References: <724462415snx@trmphrst.demon.co.uk>
- Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden
- Lines: 30
- X-Newsreader: TIN [version 1.1 + PL8]
-
- Nikki Locke (nikki@trmphrst.demon.co.uk) wrote:
- :
- : How about a -safe-c++-only switch to the compiler :-)
-
- What part of C++ is "safe" depends on the users. Some users never
- make mistakes with pointers (I'm not one of them), while others
- would like to stay away from for example pointer arithmetic.
-
- A project might have guidelines on these issues, like
-
- "don't use virtual inheritance and/or MI"
- "don't use pointer arithmetic"
- "always check the result of new for NULL"
-
- If a compiler supported a small script language for such usage constraints,
- then it would be easy to automatically check those things. Violations
- should generate warnings.
-
- Even a rather simple script language (perhaps #pragma based), that enables
- warning generation for the most commonly regarded "unsafe" features would
- IMHO be worth something.
-
- I imagine it would not be excessively difficult to add such support
- in a compiler.
-
- --
- --------------------------------------------------------------------------
- | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden |
- | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490 |
- --------------------------------------------------------------------------
-