Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2003, 04:03 AM
Elrach
Sarnak
 
Join Date: Apr 2003
Posts: 66
Default 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*'
Is there a reason why the devs don't use strcpy()? Not being a full-time programmer, I am trying to understand. Is it a question of compatibility with Windows? Efficiency of the function, resource management, or maybe just habit in coding from most devs?

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...
Reply With Quote
  #2  
Old 04-23-2003, 06:25 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

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...
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #3  
Old 04-24-2003, 06:52 AM
kathgar
Discordant
 
Join Date: May 2002
Posts: 434
Default

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
__________________
++[>++++++<-]>[<++++++>-]<.>++++[>+++++<-]>[<
+++++>-]<+.+++++++..+++.>>+++++[<++++++>-]<+
+.<<+++++++++++++++.>.+++.------.--------.>+.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:14 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3