X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=bugs%2Fdggccbug.c;h=56f522288284edf1deefed5d5ac437c6847292b8;hb=3d5bb773ecd78f75984fb096bb0be7808d3dc18d;hp=30e07a60ea4a0d526fe96648227463db1d94492c;hpb=7dfb0b774e6592dcbfe47015168a0ac8b44e2a17;p=oweals%2Fopenssl.git diff --git a/bugs/dggccbug.c b/bugs/dggccbug.c index 30e07a60ea..56f5222882 100644 --- a/bugs/dggccbug.c +++ b/bugs/dggccbug.c @@ -4,17 +4,18 @@ #include -/* There is a bug in - * gcc version 2.5.8 (88open OCS/BCS, DG-2.5.8.3, Oct 14 1994) - * as shipped with DGUX 5.4R3.10 that can be bypassed by defining - * DG_GCC_BUG in my code. - * The bug manifests itself by the vaule of a pointer that is - * used only by reference, not having it's value change when it is used - * to check for exiting the loop. Probably caused by there being 2 - * copies of the valiable, one in a register and one being an address - * that is passed. */ +/* + * There is a bug in gcc version 2.5.8 (88open OCS/BCS, DG-2.5.8.3, Oct 14 + * 1994) as shipped with DGUX 5.4R3.10 that can be bypassed by defining + * DG_GCC_BUG in my code. The bug manifests itself by the vaule of a pointer + * that is used only by reference, not having it's value change when it is + * used to check for exiting the loop. Probably caused by there being 2 + * copies of the valiable, one in a register and one being an address that is + * passed. + */ -/* compare the out put from +/*- + * compare the out put from * gcc dggccbug.c; ./a.out * and * gcc -O dggccbug.c; ./a.out @@ -23,23 +24,22 @@ void inc(a) int *a; - { - (*a)++; - } +{ + (*a)++; +} main() - { - int p=0; +{ + int p = 0; #ifdef FIXBUG - int dummy; + int dummy; #endif - while (p<3) - { - fprintf(stderr,"%08X\n",p); - inc(&p); + while (p < 3) { + fprintf(stderr, "%08X\n", p); + inc(&p); #ifdef FIXBUG - dummy+=p; + dummy += p; #endif - } - } + } +}