Re: [PATCH] max3100 driver

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

 



Arjan van de Ven <arjan@xxxxxxxxxxxxx> writes:

> I do have a question though: what does a signed bitfield of 1 mean?
> I mean.. the variables are "int", so signed.... where will the compiler
> store the sign bit???

Whether a bit-field declared as type "int" is signed or unsigned
is compiler implementation-defined.  As C99 6.7.2 says (there is
similar text in C89):

     ...for bit-fields, it is implementation-defined whether the
     specifier int designates the same type as signed int or the
     same type as unsigned int.

Thus, it is never a good idea to declare a bit-field as plain
"int".  Declare it as "signed int" or "unsigned int" instead.
-- 
"Mon peu de succès près des femmes est toujours venu de les trop aimer."
--Jean-Jacques Rousseau

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

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux