Nico Weber wrote:

> On Aug 18, 2007, at 5:00 PM, Bram Moolenaar wrote:
> > Problem:    Compiler warnings for using "const char *" for "char *".
> > Solution:   Add type casts. (Chris Sutcliffe)
> 
> at least in C++. this is a very dangerous patch. If you cast a const  
> char* to a char* and then modify the char*, you get undefined  
> behaviour (I guess this is not a problem now, but if searchpath() is  
> changed to modify its argument array in the future, then this will  
> introduce a bug). I don't know if this is true in C as well, does  
> someone know?

Sure, this is dangerous.  But we know what we're doing! :-)

Most systems put fixed strings in read-only memory, so trying to modify
it would result in a crash.

-- 
hundred-and-one symptoms of being an internet addict:
198. You read all the quotes at Netaholics Anonymous and keep thinking
     "What's wrong with that?"

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui