[Geany] WishList (I can help with implementation if you point places)

Yura Semashko yurand2 at xxxxx
Tue Jun 13 23:20:23 UTC 2006


On Tuesday 13 June 2006 18:55, Enrico Tröger wrote:

> > You don't jump if error is not in current file. For example if your
> > curent file foo.c, and you make error in foo.h you won't jump to
> > error.
>
> Works now in the SVN verson, but needs testing.
> It will jump to foo.h if it is open, if not it will be opened. But it
> can only be opened if it is found ;-). To be found, it has to be in the
> same directory like the file which was compiled.
>
> At least with the gcc, the file foo.h can be in another directory,
> e.g. in a subdirectory, because gcc prints the relative path of foo.h to
> foo.c and so it also will be opened.
> Example:
> /foo.c
> /includes/foo.h
>
> and you have an error in foo.h which is included in foo.c with
> #include "includes/foo.h" then Geany will switch/open this file.

Work, but have the following bug:

=========== foo.c ==============
#include <stdio.h>
#include "foo.h"

int main()
{
  return 0;
}
=========== foo.h ===============
int a();
jgh
int b();
==============================

Geany open foo.h fine, but in status window I see the following:
"Could not open file ./In file included from foo.c (No such file or 
directory)"

That is because error output is:
================================
In file included from foo.c:2:
foo.h:3: error: syntax error before "int"
make: *** [main] Error 1
================================

Here is a patch that fix this issue (I tested with gcc) not sure for other 
compilers error format.

Index: src/utils.c
===================================================================
--- src/utils.c	(revision 443)
+++ src/utils.c	(working copy)
@@ -2318,7 +2318,7 @@
 			// empty.h:4: Warnung: type defaults to `int' in declaration of `foo'
 			// empty.c:21: error: conflicting types for `foo'
 			pattern = ":";
-			field_min_len = 3;
+			field_min_len = 4;
 			field_idx_line = 1;
 			field_idx_file = 0;
 			break;



Another feature that will make me happy is ability to show only error summary 
after compilation (Only strings that can be used for jump to error line).
 
Syntax error are very simple most time and I don't need to watch full compiler 
output for them.

so I want only 

foo.h:3: error: syntax error before "int"

in previous example.

-- 
Best regards,
Yura Semashko



More information about the Users mailing list