1

Simple question. I am compiling an ada program with gnat. The gcc command ends up looking like gcc -c -Ia -Ibunch -Iof -Iincludes -I- -o /some/object/file.o /some/source/file.adb however the error format consists of just file.adb:line:offset: problem.

Is there any way to get GNAT make or gcc to print the full path to the file in its errors, as specified on the command line? IE: to get /some/source/file.adb:line:offset: problem.

I know that with the -gnatv one could argue that it prints the full path, but I want something significantly less verbose than that.

LambdaBeta
  • 1,479
  • 1
  • 13
  • 25

1 Answers1

4

you need -gnatef option:

-gnatef Display full source path name in brief error messages.

gcc -gnatef -c %CD%\file.adb
C:\DATA\jff\data\python\stackoverflow\file.adb:1:01: "procedure" expected

https://gcc.gnu.org/onlinedocs/gcc-4.3.6/gnat_ugn_unw/Switches-for-gcc.html

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
  • I shall accept your answer in a few minutes when I am allowed. Thank you for finding that switch. I grepped for 'absolute' and 'relative' never found the 'full' option. – LambdaBeta Oct 12 '16 at 20:34
  • I must say that I knew that the switch existed, so I googled "gnat ada full error path" and found the name of the switch (although I don't use it much: using gprbuild+GPS is way more comfortable, and in Ada you cannot have more than 1 unit with the same name so it's rarely useful) – Jean-François Fabre Oct 12 '16 at 20:36