LWN.net Logo

How Do I Make This Hard to Misuse?

How Do I Make This Hard to Misuse?

Posted Apr 1, 2008 6:42 UTC (Tue) by olecom (guest, #42886)
Parent article: How Do I Make This Hard to Misuse?

> 9. The compiler/linker won't let you get it wrong.
>
>    As a C person, I like that[...]
> compile errors (it evalates sizeof(char[1-2*!!(cond)]) which won't
> compile if cond is true).
>
>    I use this in the kernel's module_param(name, type, perm) macro to
> check that the read/write permissions for the module parameter are sane
> (a common mistake was to specify 644 instead of 0644).
[]
> 1. Read the correct mailing list thread and you'll get it right.
>
>    The reason the some strange interface quirk exists might be for
> compatibility with some strange OS or compiler, weird corner case or even
> older versions of this codebase. In other words, historical reasons ("see,
> on the VAX we only had 6 characters for..."). You sometimes only find this
> when you send a patch to fix it and the original author yells at you.
>
>    Sometimes they add it to the FAQ. That does not increase the interface's
> score very much: please try harder.

Q: don't you think streaming editor can handle that?
A: our tools have not such thing

http://article.gmane.org/gmane.linux.kernel/659995

When they will go out of the C box, or just programing language box?
Extending gcc to to waste more time, yes!
_________


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds