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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,12283be683f6446b X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Elaborate compile-time error messages (was: GNAT Stream Read ...) Date: 1999/01/06 Message-ID: <1999Jan6.072356.1@eisner>#1/1 X-Deja-AN: 429387173 X-Nntp-Posting-Host: eisner.decus.org References: <76tsgd$s0o1@svlss.lmms.lmco.com> <76uv4j$njr$1@nnrp1.dejanews.com> X-Trace: news.decus.org 915625468 16434 KILGALLEN [192.67.173.2] Organization: LJK Software Reply-To: Kilgallen@eisner.decus.org.nospam Newsgroups: comp.lang.ada Date: 1999-01-06T00:00:00+00:00 List-Id: In article <76uv4j$njr$1@nnrp1.dejanews.com>, dewar@gnat.com writes: > Surely if you use -gnatv to point out the EXACT location of > the error: > > 30. Long_Integer'Read(S, Data(ndx).elements); > | > >>> expected type "Standard.integer" > >>> found type "Standard.long_integer" > > that should be enough of a clue, it is VERY specifically > telling you that the subscript of Data must be of type > Standard.integer, and you are using long_integer. > > While you are learning Ada 95, use -gnatv as a matter of > course to tell exactly where the error message is being > posted. GNAT goes to great pains to try to post the error > in exactly the most helpful place, take advantage of this! That certainly is a high quality error message. I am curious as to why it is not the default. Is there some set of programmers who get really mad at having the compiler be smarter than they are about the nature of a problem. I first used Ada with DEC Ada, where the error messages are also quite complete, and it has never occurred to me to look for a way to make them shorter. Larry Kilgallen