On Friday 18 January 2008 03:47:01 am Giacomo A. Catenazzi wrote: > Changing the name of variables in your example: > > extern print_int(const int *); > > int main(int argc, char **argv) > { > extern int errno; > > errno = 0; > print_int(&i); > return errno; > }
Except that changing int to extern int makes all the difference in the world: the variable went from being local to being global. The way const is currently defined, however, the compiler cannot take advantage of the fact that the variable was local in the former case. > Ok, I changed int to extern int, but you see the point? > Do you want complex rules about const, depending on > context (extern, volatile,...) ? Sometimes complexity is worth it. -- Vadim Lobanov -- 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/