This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-2.95.2 compiler bug:
- To: timj at gtk dot org
- Subject: Re: gcc-2.95.2 compiler bug:
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sun, 17 Oct 1999 02:34:11 +0200
- CC: gcc-bugs at gcc dot gnu dot org, bug-gcc at gnu dot org
- References: <199910152250.AAA22097%timj@gtk.org>
> 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