String assignment vs strcpy()
I got a question. When I compile my code on Linux using gcc3.2.2 I get tons of warnings. One that comes up a lot is:
Code:
client.cpp:1866: warning: deprecated conversion from string constant to `char*' Would it be worth the effort to peruse the code to clean them out. It seems a lot of the warnings have to do with improper data types being passed to functions, (double passed as argument to an int). Since I'm a network admin, I don't see code everyday. Is it a general acceptable practice among programmers, or is it sloppyness? I'm thinking that if the right data types were passed, it would improve efficiency. Trying to understand, and also trying to help improve EQEmu (and myself in the process). Let me know... |
It would definitely be worthwhile, I'd say its just a general habit, alot of us arent pro programmers either (Im a Systems Engineer for example, and my code is all in java), so they are probably plenty of bad habits/personal nuisances that could be done better...
I don't know how hazardous the practice is, but i don't mind cleaning it up.. If you've got anymore information on it let me know, we'll see if we can mop the code a little.. Believe me, you are preaching to the choir..lol.. I hade linux gcc compiles down to 0 warnings 4 months ago, but it got tiring cleaning up after the windows developers who have no rigid warning codes in their compilers (DAMN VC!). Then theres Wes, Mr. Warnings dont mean anything, so you understand the battle us poor linux guys have to fight..lol... There are tons of things that need casting. Some dont worry me, some do... |
Half of the time they are just passing arguments and not casting, where strcpy or such would not really aplly.. I haven't looked at them all but there are probably mistakes where it would be better but on the average its not really a big deal
|
All times are GMT -4. The time now is 10:26 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.