Monday 19 March 2012

Give your function a bad name and ruins it all

I do not know about other compilers, but I happen to use a compiler which does not protect system function names, that is, if you define a function read(), it overrides some system function read() and messed up all kinds of stuff. If you rename it as readxxx(), then everything works.

This sounds really stupid, but be careful when you name your functions. Adding a prefix maybe a good idea.

No comments:

Post a Comment