Search Linux Wireless

Re: [PATCH] v2: rtl8187: micro cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2010-02-17 at 19:38 +0100, okias wrote:
> You have probably right, but when I use my testing program:
> 
> #include <stdio.h>
> main() {
> int a;
> printf("%i\n", a);
> a |= 22;
> printf("%i\n", a);
> }
> 
> Output is:
> 0
> 22
> 
> it look correct to me

That's what I get if compiling for x86_64.  If compiling for i386, I get

1258024948
1258024950

It just happens that 0 is on the stack where the variable is allocated,
perhaps as a leftover from another call that used that area on the
stack.

No C standard says that automatic variables are initialized.  And
indeed, they are not!

gcc will warn about it with -Wall

Please let's stop this discussion now, as it doesn't belong to the
linux-wireless mailing list.

-- 
Regards,
Pavel Roskin
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux