public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Pfaff <blp@cs.stanford.edu>
To: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] max3100 driver
Date: Sun, 21 Sep 2008 09:09:21 -0700	[thread overview]
Message-ID: <87bpyhfpla.fsf@blp.benpfaff.org> (raw)
In-Reply-To: 20080920065652.11d76780@infradead.org

Arjan van de Ven <arjan@infradead.org> 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


  parent reply	other threads:[~2008-09-21 16:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-20  7:20 [PATCH] max3100 driver Christian Pellegrin
2008-09-20  8:24 ` Andrew Morton
2008-09-20 10:35   ` chri
2008-09-20 13:56   ` Arjan van de Ven
2008-09-20 14:30     ` chri
2008-09-20 14:34     ` Alan Cox
2008-09-21 16:09     ` Ben Pfaff [this message]
2008-10-09  6:23   ` chri
2008-10-10 12:08   ` Christian Pellegrin
2008-09-20 14:11 ` Alan Cox
2008-09-20 14:37   ` chri
2008-10-09  6:30   ` chri
2008-10-09  9:18     ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2008-09-20 10:51 Michael Trimarchi
2007-12-17  8:17 chripell
2007-12-17  8:45 ` Jiri Slaby
2007-12-17  8:55   ` chri
2007-12-17  9:00     ` Jiri Slaby
2007-12-05 10:26 chripell
2007-12-12  9:49 ` Andrew Morton
2007-12-12 11:58   ` chri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bpyhfpla.fsf@blp.benpfaff.org \
    --to=blp@cs.stanford.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox