C-Breeze has a few known bugs, and probably at least as many unknown bugs. Many bugs have been removed from C-Breeze (and some added!) recently (as of the writing of this document, summer 1999). The bugs listed here remain because their causes are hard to find, or the cause is known but the solution is sufficiently difficult to implement that it has not yet been worth the effort. These are the known bugs:
{ int a;
...
}
{ double a;
...
}
from being a problem, but for some reason global variables aren't handled properly sometimes. Thus, the dismantler will hide certain instances of global variables that result from questionable programming practices, e.g.:
int a;
void foo (void) {
if (a == 1) {
int a;
a = 2; /* changing local a */
}
else
a = 1; /* changing global a */
}
The dismantled code looks like this:
int a;
void foo(void)
{
int __IES2;
int __TE0;
int a1;
__TE0 = a == 1;
__IES2 = __TE0;
if (__IES2)
goto __IES0;
a = 1;
goto __IES1;
__IES0:
;
a1 = 2;
__IES1:
;
return ;
}
The last assignment to a1, the renamed local a, should have been to global a. The workaround is not to code this way! Please! I spent a whole day tracking down this silliness in the GCC sources!
void foo (void) {
char s[100];
int index;
for (index=0; index<100; index++)
s[index] = 0;
}
It looks perfectly reasonable, but if you have #included "string.h", C-Breeze won't like it because index is the name of a standard C library function. Since any C program in which the programmer uses a reserved identifier (such as index, printf, anything beginning with str, etc.) as a variable name doesn't strictly conform to the ISO9899 standard, C-Breeze's behavior is excusable, if annoying, in cases like this. However, it is wrong when a local variable is mistaken for a user-declared function. The workaround is to rename the local variable.
A declaration of the form
struct-or-union identifier identifier ;
specifies a structure or union type and declares a tag, both visible only within the scope in which the declaration occurs.
The following test program illustrates the problem:
int a (void) {
struct foo { int bar; };
}
int b (void) {
struct foo baz;
baz.bar = 1;
}
C-Breeze cheerfully accepts this, but struct foo is plainly an incomplete type in function b. It's been this author's experience that when tags are reused like this, the same structure is often also defined, so the bug is usually not much of a problem. One can imagine situations in which this could become troublesome. The workaround is to rename the offending tag when this bug is encountered.