Re: Complaint about return code convention in queue_work() etc.

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

 



>> >Mixing up these two sorts of representations is a fertile source of
>> >difficult-to-find bugs.  If the C language included a strong distinction
>> >between integers and booleans then the compiler would find these mistakes
>> >for us... but it doesn't.
>> 
>> Recently introduced "bool".
>
>I haven't seen the new definition of "bool", but it can't possibly provide 
>a strong distinction between integers and booleans.  That is, if x is 
>declared as an integer rather than as a bool, the compiler won't complain 
>about "if (x) ...".

Only Java will get you this distinction. I would be comfortable with a 
feature where conditionals (like if() and ?:) enforce a bool showing 
up in C/C++, but it's not easy to get into the mainline gcc.


Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux