This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc-2.95.2 compiler bug:


> hm, this one didn't get through because of size restrictions,
> i'm sending you .gz files now.

Ok, I can reproduce the problem. There is a serious bug in the code;
you write

  BST_DEBUG (SAMPLES, {
    GList *free_list = bst_sample_repo_list_sample_locs (), *list;

    for (list = free_list; list; list = list->next)
      {
	BstSampleLoc *loc = list->data;
	
	g_print ("%s:: %s\n", loc->repo->name, loc->name);
      }
    g_list_free (free_list);
  });

where BST_DEBUG is

#define BST_DEBUG(type, code)   G_STMT_START { \
  if (bst_debug_flags & BST_DEBUG_##type) \
    { code ; } \
} G_STMT_END

Now, the "second" parameter to BST_DEBUG has a number of commas in it,
which result in many more macro argument. gcc complains but continues,
giving the preprocessor output.

  (void)(  { if (bst_debug_flags & BST_DEBUG_SAMPLES ) {   {
    GList *free_list = bst_sample_repo_list_sample_locs ()  ; } } )  ;

With that being fixed, gcc complains

x.c:113: `BstSampleLoc' undeclared (first use in this function)
x.c:113: (Each undeclared identifier is reported only once
x.c:113: for each function it appears in.)
x.c:113: `loc' undeclared (first use in this function)

which also looks like a genuine bug in your code.

Since the crash in gcc has an easy work-around (fix the code), it is
unlikely that anything else will be done about it for gcc 2.95.x

Hope this helps,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]