Re: [dev] [sic] [patch] const-correctness and formalities

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Thu, 22 Aug 2013 11:58:26 +0200

On Thu, Aug 22, 2013 at 12:15:23PM +0300, sin wrote:
> > +eat(char *s, int (*p)(int), const int r) {
>
> `const int r' also does not make much sense.
> This is not idiomatic code.

I agree with you. Since r is a local variable doesn't matter if
the function modifies it (and even is better modify it instead of
using other local variable for it). I use const only when I want
show that the function is going to accept constant string which
should not be modified, like for example:

printf(const char *fmt, ...)


-- 
Roberto E. Vargas Caballero
----------------------------
k0ga_AT_shike2.com
http://www.shike2.com
Received on Thu Aug 22 2013 - 11:58:26 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 22 2013 - 12:00:08 CEST