Author Topic: All devs: watch out for memset  (Read 2567 times)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
All devs: watch out for memset
« on: March 07, 2007, 01:58:51 am »
I've just read some note written by Krzysztof Kowalczyk on his blog titled: "memset() considered harmful" ().
He has written that people usually swap second ant third parameter which in case of zeroing some data will do nothing.

There's also a query which shows that at least half of calls is invalid.

I've already checked C::B and it has no such "mistakes" :D
But it may be a good tip to check your code ;)


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
Re: All devs: watch out for memset
« Reply #1 on: March 07, 2007, 07:25:25 am »
Whohooo... found one... in a quite old piece of code. Luckily it was only *one* and obviously it didn't cause any harm. But the number of google results scare me a little... ;-)
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: