[BusyBox] Building uname...

Edmund Troche edmund at troche.org
Sun Mar 24 14:38:04 UTC 2002


I went into uname.c and made the "opt" variable volatile, and this allows me
to compile with optimization. Again, I'm not sure what the compiler is really
doing here, but it seems like it's messing things up when it tries to
optimize the code. Making this variable volatile tells the compiler not to
mess with it, so I guess that fixed it.


Edmund


Thomas Cameron wrote:

> Hello again,
>     I looked at the CVSWeb system, and looked at the latest changes
> (v1.16 to v1.17).  There's only two lines changed.  The earliest changes
> before 1.17 is back in december, when version 1.16 was committed.  I
> know that it worked from December until a few days ago.  So, here's the
> two changed lines:
>
> ==========================================
> Line 96:
>          strcpy(uname_info.processor, "unknown");
>
>          for (delta=utsname_offset ; toprint ; delta++, toprint >>= 1) {
>                  if (toprint & 1) {
>                          printf("%s ", ((char *)(&uname_info)) + *delta
> );
>                  }
>          }
>
>          putchar('\n');
>
>          return EXIT_SUCCESS;
> ==========================================
>
> ==========================================
> Line 96:
>          strcpy(uname_info.processor, "unknown");
>
>          for (opt=0,delta=utsname_offset ; toprint ; delta++, toprint
> >>= 1) {
>                  if (toprint & 1) {
>                          printf("%s%s", (opt++==0)? "": " ", ((char
> *)(&uname_info)) + *delta);
>                  }
>          }
>
>          putchar('\n');
>
>          return EXIT_SUCCESS;
> ==========================================
>
>     Basically, from what I can tell, the only difference, to the uname.c
> source at least, is the addition of the "opt" variable.  But if opt was
> added, would that really cause a problem?  Can someone try to revert
> their uname.c to version 1.16, and try to recompile?  What about back to
> version 1.15?  Anyway, give it a try, and let us know.
>
> Thomas Cameron
> CEI Systems
>
>
>         -----Original Message-----
>         From: Edmund Troche
>         Sent: Sun 3/24/2002 6:49 AM
>         To: Thomas Cameron
>         Cc: busybox at busybox.net
>         Subject: Re: [BusyBox] Building uname...
>
>
>
>
>   ------------------------------------------------------------------------
>                   Name: winmail.dat
>    winmail.dat    Type: application/ms-tnef
>               Encoding: base64




More information about the busybox mailing list