comp.lang.ada
 help / color / mirror / Atom feed
From: Matthieu Moy <MatthieumNOSPAM@yahoo.com>
Subject: References in error message for use with Emacs.
Date: 14 Jan 2002 17:38:28 +0100
Date: 2002-01-14T16:38:28+00:00	[thread overview]
Message-ID: <vpq6664ubuj.fsf@ubaye.imag.fr> (raw)

I use gnat as a compiler and Emacs as editor. Error messages like 

list_brackets.adb:46:07: not type conformant with declaration at list_brackets.ads:22

Bored me because Emacs could only show me the reference in the
begining of line, and not the declaration referenced at the end.

I wrote a small wrapper for that (for unix) :

The directory ~/bin must be in the begining of the path. Then, put an
executable file in this directory containg the following code:

#!/bin/sh
# This is a small wrapper for gnatgcc. It adds some lines when a
# reference is cited in an error message, such as
#
# list_brackets.adb:31:18: left operand has type "Ptr_String" defined at basic_types.ads:16
#
# Who becomes
#
#
# list_brackets.adb:31:18: left operand has type "Ptr_String" defined at basic_types.ads:16
# basic_types.ads:16: (Reference cited in previous line)
#
/usr/bin/gnatgcc "$@" 2>&1 | sed 's/^\([^:]*:.* \([^ ]*\.ad[bs]:[0-9]*\).*\)$/\1\
\2: (Reference cited in previous line)/g'

and from now, gnatmake will show this kind of error messages :

list_brackets.adb:46:07: not type conformant with declaration at list_brackets.ads:22
list_brackets.ads:22: (Reference cited in previous line)

and Emacs can lead you to both references.

May I suggest, if this is not the case, that the next versions of gnat
give this kind of message without any wrapper (as gcc does for C) ?

-- 
| Matthieu MOY



             reply	other threads:[~2002-01-14 16:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-14 16:38 Matthieu Moy [this message]
2002-01-14 17:06 ` References in error message for use with Emacs Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox