I wonder, what sort of technology would have avoided this? The "key -r" bit seems a bit suspicious type wise
Without getting into typing, a simple
warning: arithmetic inside sizeof
would catch this. I don't think it would catch much noise, I don't see any useful uses of pointer arithmetic immediately inside a sizeof. It's a bit specific though, are there more functions that would benefit as well? a = malloc(sizeof(*a));
It's also useful for various hacks (stuff like compile-time assert macros), since it doesn't evaluate the expression, only its type.But it perhaps it could be useful for those following the NetBSD style. :-)