Re: FAQ: #define ... do { ... } while(0)

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

 



On Tue, Sep 25, 2001 at 10:46:12AM +0200, Per Persson wrote:
> As another guy wrote this isn't really a kernel question, but rather a
> C-language question, and thus doesn't really belong to this FAQ.
Well, the kernel FAQ doesn't state its mission and scope. So, I guess it is intended to help people to learn and understand the kernel, at any level from the hardware to the application. Why are there CPU-related answers in the FAQ if they can be found on many hardware sites?

I think it's good that do-while question is answered in the FAQ -- it is intended to help people. I think it's bad that it isn't answered the way you propose -- the current answer is rather obscure for an unenlightened (whom the answer is supposed to help).

> Should we perhaps propose a C-language FAQ at KernelNewbies? It should in my
> opinion then be biased towards the C-language constructions used in the
> kernel, especially the GCC extensions.
This is a "standard" development way for _reference_ documentation. It should be complete and precise; purism is a good policy to achieve that. On the other hand, why people find FAQs useful? I think it's because: (a) FAQs answer questions as they arise (one doesn't have to know all about everything to do smth; learning is faster and easier, since it's learner-centered), and (b) they cover many "intermediate" topics not answered in "reference" docs. The "F" in "FAQ" implies that people often ask this question, and ask it on linux-kernel. Why refuse to help them?

I don't believe there would be many gcc-specific topics. I found answers to all questions I had in "info gcc". do-while trick is a preprocessor hack; if it is described elsewhere, we can remove the answer from the FAQ and refer to that (more appropriate) place. But in any case, I personally don't like the presence of an unclear answer in the FAQ.

Just my $ 0.02.

With best regards,
Baurjan.
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux