Author Topic: OT Programming: this is why I dislike c++  (Read 2046 times)

0 Members and 1 Guest are viewing this topic.

Offline John Coloccia

  • Super Contributor
  • ***
  • Posts: 1199
  • Country: us
Re: OT Programming: this is why I dislike c++
« Reply #25 on: February 10, 2018, 04:47:38 pm »
Personally, I don't think it's a particularly subtle bug. It's hard to see in the OP because you can't see the .h file, so it's somewhat impossible to figure out other than guessing.

It's been a while since I've played with C++ regularly, but I seem to recall that you should get a warning about taking the address of a temporary. Why was the warning ignored? If this is one of those code bases where every file throws dozens of warnings, I'm not surprised if it's littered with amateurish bugs. I've never understood why warnings are just simply ignored instead of being fixed. We strive for squeaky clean compiles and it's the extremely rare case that can't be reasonably fixed, or where the code is 100% correct and there's no way around the warning. For example, One of my current projects involves a code base that's roughly somewhere between 50,000 and 100,000 lines and a dozen or so separate projects (haven't really counted in a while so I forget). I think the entire code base might have a total of 3 or 4 warnings in it, and they're all at the link stage where we've had to do some funkiness in the memory map.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 10299
  • Country: gb
    • Having fun doing more, with less
Re: OT Programming: this is why I dislike c++
« Reply #26 on: February 10, 2018, 04:51:53 pm »
It's hard to see in the OP because you can't see the .h file, so it's somewhat impossible to figure out other than guessing.

That - in itself - is a mminot form of obfustication. The same can be said of knitting enterprise Java code together with XML.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf