From: Robert Hancock <hancockr@shaw.ca>
To: Cong WANG <xiyou.wangcong@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Style Question
Date: Sun, 11 Mar 2007 09:47:43 -0600 [thread overview]
Message-ID: <45F4249F.2080501@shaw.ca> (raw)
In-Reply-To: <fa.Da+t1e9MgP7HaKS+dOWXVD8aYNI@ifi.uio.no>
Cong WANG wrote:
> Hi, list!
>
> I have a question about coding style in linux kernel. In
> Documention/CodingStyle, it is said that "Linux style for comments is
> the C89 "/* ... */" style. Don't use C99-style "// ..." comments."
> _But_ I see a lot of '//' style comments in current kernel code.
>
> Which is wrong? The documentions or the code, or neither? And why?
The code.. As with a lot of coding style issues, it's likely just that
nobody saw it and bothered to complain when it went in.
> Another question is about NULL. AFAIK, in user space, using NULL is
> better than directly using 0 in C. In kernel, I know it used its own
> NULL, which may be defined as ((void*)0), but it's _still_ different
> from raw zero. So can I say using NULL is better than 0 in kernel?
It's the preferred style, Sparse will complain about using 0 for a null
pointer for example..
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next parent reply other threads:[~2007-03-11 15:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.Da+t1e9MgP7HaKS+dOWXVD8aYNI@ifi.uio.no>
2007-03-11 15:47 ` Robert Hancock [this message]
2007-03-11 14:15 Style Question Cong WANG
2007-03-11 14:22 ` Bernd Petrovitsch
2007-03-11 20:35 ` Jan Engelhardt
2007-03-11 20:41 ` Daniel Hazelton
2007-03-11 22:01 ` Kyle Moffett
2007-03-11 23:16 ` Jan Engelhardt
2007-03-12 1:27 ` Kyle Moffett
2007-03-12 1:32 ` Jan Engelhardt
2007-03-12 1:43 ` Kyle Moffett
2007-03-12 5:37 ` Cong WANG
2007-03-12 5:40 ` Jan Engelhardt
2007-03-12 5:52 ` Nicholas Miell
2007-03-12 6:18 ` Randy.Dunlap
[not found] ` <MDEHLPKNGKAHNMBLJOLKOEBCCDAC.davids@webmaster.com>
2007-03-12 13:52 ` Cong WANG
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=45F4249F.2080501@shaw.ca \
--to=hancockr@shaw.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.