[riot-devel] Coding conventions amendment

Kees Bakker kees at sodaq.com
Fri Oct 14 08:05:51 CEST 2016


On 13-10-16 22:42, Kaspar Schleiser wrote:
> Hi,
>
> On 10/13/2016 09:43 PM, Kees Bakker wrote:
>>>> Does anybody object to adding this to the coding
>>>>>> conventions explicitly?
>>>> What about `size_t`?
>> +1 for size_t
> Well, any convention would need careful wording.
>
> ```
> for (uint32_t timeout = 1; timeout < (10LU*1000*1000); timeout *= 2) {
> 	if(try()) break;
> }
> ```
>
> ... cannot blindly by convention converted to size_t as loop variable.

Of course not.
But I believe the question was more, in case of an unsigned type,
should we use "unsigned int" or size_t. In that case I would go for size_t.

> IMHO this example also answers Oleg's initial concern: sometimes int or
> unsigned int or size_t just don't work.

Sure.

-- 
Kees Bakker
Founder
SODAQ
M. 0031617737165
www.sodaq.com



More information about the devel mailing list