[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-bug: libgeda compile error when DEBUG = 1



Full_Name: Stuart Brorson
Version: CVS of 1.25.2005
OS: Linux FC2
Submission from: (NULL) (24.218.17.179)


When I set #define DEBUG  1 in libgeda/config.h, then gcc barfs with this
message:

 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I/usr//include/gtk-2.0
-I/usr//lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
-I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr//include/glib-2.0
-I/usr//lib/glib-2.0/include -I/usr/X11R6/include -g -O2 -MT s_tile.lo -MD -MP
-MF .deps/s_tile.Tpo -c s_tile.c  -fPIC -DPIC -o .libs/s_tile.o
s_tile.c: In function `s_tile_free_all':
s_tile.c:430: error: `objects' undeclared (first use in this function)
s_tile.c:430: error: (Each undeclared identifier is reported only once
s_tile.c:430: error: for each function it appears in.)
s_tile.c:432: error: `real_object' undeclared (first use in this function)
make[3]: *** [s_tile.lo] Error 1
make[3]: Leaving directory `/usr/local/src/geda/devel/libgeda/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/src/geda/devel/libgeda/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/geda/devel/libgeda'
make: *** [all] Error 2


The relevant section of code is:

void s_tile_free_all(PAGE * p_current)
{
  int i, j;
  TILE *t_current;
 
  for (j = 0; j < MAX_TILES_Y; j++) {
    for (i = 0; i < MAX_TILES_X; i++) {
      t_current = &p_current->world_tiles[i][j];
      if (g_list_length(t_current->objects) != 0) {
        fprintf(stderr,
                "OOPS! t_current->objects had something in it when it was
freed!\n");
        fprintf(stderr, "Length: %d\n", g_list_length(t_current->objects));
 
 
#if DEBUG
        printf("%s %d %d\n", p_current->page_filename, i, j);
        objects = t_current->objects;
        while (objects != NULL) {
          real_object = (OBJECT *) objects->data;
          printf("yes %s\n", real_object->name);
          objects = objects->next;
        }
 
        if (t_current->objects == NULL) {
          printf("yes null\n");
        }
#endif
 
      }
      g_list_free(t_current->objects);
    }
  }
}


It looks like some undefined variables are used inside the #ifdef DEBUG
section.
I will continue building by just making this #if 0, but we should fix this. 
Maybe I'll do it later . . . .