[BusyBox] gcc3.3 (SuSE8.2) crashed compiling dump.c

Soewono Effendi seffendi at web.de
Wed Jul 23 18:31:29 UTC 2003


Hi all, 
 
GCC 3.3 under (SuSE 8.2) crashed compiling 'busybox-1.00-pre1*. It is caused by the optimization option (-Os). 
This patch works around the problem. This problem has been reported to GCC and SuSE. 
 
best regards, 
S. Effendi 
 
--- dump.c      21 Apr 2003 10:26:39 -0000      1.6 
+++ dump.c      23 Jul 2003 18:33:57 -0000 
@@ -176,13 +176,14 @@ static void rewrite(FS * fs) 
                        DO_INT_CONV: 
                                { 
                                        const char *e; 
+                                       unsigned int flags = F_INT; 
                                        if (!(e = strchr(lcc, *p1))) { 
                                                goto DO_BAD_CONV_CHAR; 
                                        } 
-                                       pr->flags = F_INT; 
                                        if (e > lcc + 1) { 
-                                               pr->flags = F_UINT; 
+                                               flags = F_UINT; 
                                        } 
+                                       pr->flags = flags; 
                                        byte_count_str = "\004\002\001"; 
                                        goto DO_BYTE_COUNT; 
                                } 
@@ -200,7 +201,7 @@ static void rewrite(FS * fs) 
                                } else if (sokay == USEPREC) { 
                                        pr->bcnt = prec; 
                                } else {        /* NOTOKAY */ 
-                                       bb_error_msg_and_die("%%s requires a precision or a byte count."); 
+                                       bb_error_msg_and_die("%%%s requires a precision or a byte count.", p1); 
                                } 
                        } else if (*p1 == '_') { 
                                ++p2; 
@@ -288,7 +289,7 @@ static void rewrite(FS * fs) 
         * if, rep count is greater than 1, no trailing whitespace 
         * gets output from the last iteration of the format unit. 
         */ 
-       for (fu = fs->nextfu;; fu = fu->nextfu) { 
+       for (fu = fs->nextfu; fu; fu = fu->nextfu) { 
                if (!fu->nextfu && fs->bcnt < bb_dump_blocksize && 
                        !(fu->flags & F_SETREP) && fu->bcnt) 
                        fu->reps += (bb_dump_blocksize - fs->bcnt) / fu->bcnt; 
 
______________________________________________________________________________
Wo gibt es den besten Spam-Schutz? Laut ComputerBild 15-03 bei
WEB.DE FreeMail - Deutschlands beste E-Mail - http://s.web.de/?mc=021122
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 1437 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.busybox.net/pipermail/busybox/attachments/20030723/e23e22a1/attachment.bin 


More information about the busybox mailing list