On Mon, Mar 20, 2006 at 10:36:23PM +0100, Joerg Schilling wrote: > If you really like to use const char *, then it may needed to change thousands > of lines. And even then you would not find:
Yes, I understand. I wasn't suggesting to change the code but rather to examine it. In most cases, larger programs are sure to have missing const's. This is why gcc's -Wwrite-strings is off by default and has to be specially enabled. And why this approach is only sensible for very small programs that probably wouldn't be too hard to test anyway. > const char *p = "test"; > char * p2; > > p2 = strchr(p, 't') > *p2 = 'u'; Yes, there are a number of standard library and system functions which could or should have their return types const-qualified but don't. Historical and conformance reasons, of course, but it makes -Wwrite-strings and similar options rather useless. -- Keith M Wesolowski "Sir, we're surrounded!" Solaris Kernel Team "Excellent; we can attack in any direction!" _______________________________________________ opensolaris-discuss mailing list opensolaris-discuss@opensolaris.org