Article View: comp.std.c++
Article #4025Re: Draft Std. C++ Preprocessor
From: David Wald
Date: Sun, 14 Apr 1996 11:50
Date: Sun, 14 Apr 1996 11:50
51 lines
3416 bytes
3416 bytes
In article <4klsr0$ii4@engnews1.Eng.Sun.COM> clamage@Eng.Sun.COM (Steve Clamage) writes: >In article 0804961108400001@news.aimnet.com, mike_duigou@fwb.com >(Mike Duigou) writes: >>One change I was hoping for was the inclusion of a non-fatal >>"#warning" directive to match the fatal '#error" directive. (hey, >>the compiler can make both errors and warnings, why can't I?). As >>you probably know, a number of compilers support the #warning >>directive. > >We've been through this discussion many times. The #error directive isn't >required to be fatal. All that is required is that it cause a message to >be emitted. It is difficult to specify "fatal" versus "non-fatal" in a >system-independent way. So don't specify it. I've seen the discussion go around a few times, but I can't say I've ever understood the objection to requiring #warning in the standard and letting the distinction be implementation-defined. The fact that there isn't a useful distinction in some environments doesn't diminish the usefulness of a #warning directive in the large number of environments which *do* support such a distinction. This wouldn't be the first item in the standard that could be more usefully implemented in some environments than in others. >Adding non-standard directives like #warning is not very programmer- >friendly. Right; that's why it should not be non-standard. As a non-standard extension it's of fairly limited utility. As a standard feature, it would be useful in many environments, and particularly useful when you're porting code to a new environment -- i.e., when the code you're porting by definition can't have any compiler-specific #pragmas available. Its utility would lie in its portability; all compilers would accept it, and the worst they'd do would be to behave exactly as if they'd seen an #error. Many compilers would do better than that. The problem is that there is now no portable way to hint to the compiler that it may as well go on processing after a particular #error, even though the compiler is permitted to do so. -David -- ============================================================================ David Wald http://theory.lcs.mit.edu/~wald/ wald@theory.lcs.mit.edu ============================================================================ --- [ comp.std.c++ is moderated. To submit articles: try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ] [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ] [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Technical Details
Message-ID:
<WALD.96Apr12143619@woodpecker.lcs.mit.edu>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<mike_duigou-0804961108400001@news.aimnet.com> <4klsr0$ii4@engnews1.Eng.Sun.COM>Show Full Headers
Complete Article Headers
From: wald@theory.lcs.mit.edu (David Wald) Message-ID: <WALD.96Apr12143619@woodpecker.lcs.mit.edu> X-Original-Date: 12 Apr 1996 18:36:19 GMT Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 14 Apr 96 11:50:59 GMT Approved: fjh@cs.mu.oz.au Newsgroups: comp.std.c++ Subject: Re: Draft Std. C++ Preprocessor Organization: Theory of Computation, LCS, MIT References: <mike_duigou-0804961108400001@news.aimnet.com> <4klsr0$ii4@engnews1.Eng.Sun.COM> In-Reply-To: clamage@Eng.Sun.COM's message of 12 Apr 96 16:25:37 GMT X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMXDmxuEDnX0m9pzZAQFJkgF/RRGKOqw2lByK8XiwrGmnf3ZAJa0Ey2Vk 4HYvLVwDdGxL/g2DeuQ4swekulEZlZZt =490h