home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:20306 comp.lang.c++:20028
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!cs.utexas.edu!geraldo.cc.utexas.edu!emx.cc.utexas.edu!not-for-mail
- From: jamshid@emx.cc.utexas.edu (Jamshid Afshar)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: C/C++ Correctness (was: Re: C/C++ Speed)
- Date: 27 Jan 1993 13:01:27 -0600
- Organization: The University of Texas at Austin, Austin, Texas
- Lines: 33
- Message-ID: <1k6m67INNgqv@emx.cc.utexas.edu>
- References: <1993Jan14.005444.18580@csservices.Princeton.EDU> <1jic36INNhn5@emx.cc.utexas.edu> <1993Jan20.185607.2938@borland.com>
- NNTP-Posting-Host: emx.cc.utexas.edu
-
- In article <1993Jan20.185607.2938@borland.com> pete@borland.com (Pete Becker) writes:
- >In article <1jic36INNhn5@emx.cc.utexas.edu> jamshid@emx.cc.utexas.edu (Jamshid Afshar) writes:
-
- int i;
- int** p = &i;
-
- >>Matthias writes:
- >>>No, this is definitely a serious type error in ANSI C and *must* be
- >>>rejected by the compiler!
-
- >>No, it is just a warning in ANSI C. If you're testing this with BC++
- >>3.1, apparently even C compilers have bugs.
-
- The reason I wrote this is that I compiled the code in what I thought
- was BC++'s strict ANSI C mode. BC++ gave an error and refused to
- compile the code. I thought Matthias believed type errors like this
- are illegal in ANSI C because he was testing with BC++. As it turns
- out, BC++ could not have been the source of his confusion. I made the
- mistake of compiling in C++ mode instead of ANSI C mode. To sum up,
- BC++ does not have any bug in this area. I don't know where Matthias
- got the idea that the above code is not legal ANSI C.
-
- > ANSI C requires that a compiler "issue a diagnostic" for code that does
- >not conform to the standard. It does not require the compiler to refuse to
- >compile the program. Producing a warning satisfies the ANSI requirement.
-
- But isn't the above code legal C? Isn't an ANSI C compiler *required*
- to compile the code (and required to issue some kind of warning). My
- point is that the above code will be compiled by an ANSI C compiler,
- but not by a C++ compiler.
-
- Jamshid Afshar
- jamshid@emx.utexas.edu
-