From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5d71,304c86061dc69dba X-Google-Attributes: gidf5d71,public X-Google-Thread: 109fba,304c86061dc69dba X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,304c86061dc69dba X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,5cb36983754f64da X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-11 11:31:30 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: robert.thorpe@antenova.com (Rob Thorpe) Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java Subject: Re: No call for Ada (was Re: Announcing new scripting/prototyping language) Date: 11 Feb 2004 11:31:30 -0800 Organization: http://groups.google.com Message-ID: <1a61f7e5.0402111131.2667fa6@posting.google.com> References: <20040206174017.7E84F4C4114@lovelace.ada-france.org> <54759e7e.0402071124.322ea376@posting.google.com> <2460735.u7KiuvdgQP@linux1.krischik.com> <54759e7e.0402081525.50c7adae@posting.google.com> NNTP-Posting-Host: 193.128.174.131 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1076527890 30340 127.0.0.1 (11 Feb 2004 19:31:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 11 Feb 2004 19:31:30 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:5448 comp.lang.c:21944 comp.lang.c++:18740 comp.lang.java:2862 Date: 2004-02-11T11:31:30-08:00 List-Id: Ludovic Brenta wrote in message news:... ... > which is not possible in C: > > typedef enum { YES, NO, MAYBE, MAYBE_NOT } assessment_t; > > void P (assessment_t A) { } > > int main () { > P (42); // no compiler check! > return 0; > } In C enums are interchangable with ints so there is no error, though there maybe the compiler should give a warning. A C++ compiler should check I got: bash-2.05b$ g++ -Wall fiddle.cpp fiddle.cpp: In function `int main()': fiddle.cpp:6: error: invalid conversion from `int' to `assessment_t'