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.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: bourguet@my-dejanews.com Subject: Re: Elaborate compile-time error messages (was: GNAT Stream Read ...) Date: 1999/01/06 Message-ID: <7703mi$nlk$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 429426823 References: <76tsgd$s0o1@svlss.lmms.lmco.com> <76uv4j$njr$1@nnrp1.dejanews.com> <1999Jan6.072356.1@eisner> X-Http-Proxy: 1.0 x6.dejanews.com:80 (Squid/1.1.22) for client 158.140.208.29 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Jan 06 16:40:50 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.05 [en] (X11; I; SunOS 5.5.1 sun4u) Date: 1999-01-06T00:00:00+00:00 List-Id: In article <1999Jan6.072356.1@eisner>, Kilgallen@eisner.decus.org.nospam wrote: > 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. AFAIK, the only thing that -gnatv change is the way the error position is referenced (and Robert message does not let me think otherwise). Without -gnatv, gnat issue an error message with the position given as filename:linenum:colnum. With -gnatv gnat issue the same message but with the position given by a two line listing and a | pointing to the character. Why is it not the default? I do not know for sure: the default is more dense and correspond to the coding standard of the FSF (other compilers based on gcc issue the same kind of messages, emacs is able to parse these error messages and use them to point you directly on the problem). When I do not compile under emacs I usually use the -gnatv (or even recompile under emacs when I see 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. The error messages from gnat are the best I've ever seen in a compiler. I'd like the c++ compiler I use at work issue half as good error messages (it issue routinely when there is a problem in template instanciation the worst error message I've ever seen: a crash preceded by a totaly irrelevant message applyed to a random line number). -- Jean-Marc -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own