Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Monday October 23 2017, @06:48AM   Printer-friendly
from the MY-code-is-perfect! dept.

I am really astonished by the capabilities of static code analysis. The tool surprised me the other day as it turned out to be smarter and more attentive than I am. I found I must be careful when working with static analysis tools. Code reported by the analyzer often looks fine and I'm tempted to discard the warning as a false positive and move on. I fell into this trap and failed to spot bugs...Even I, one of the PVS-Studio developers.

So, appreciate and use static code analyzers! They will help save your time and nerve cells.

[Ed note: I debated running this story as there was an element of self-promotion (aka Bin Spam), but the submitter has been with the site for a while and has posted informative comments. Besides, I know there have been far too many times when I've seen a compiler complain about some section of my code and I'm thinking there is nothing wrong with it — and then I, finally, see my mistake. Anyone have samples of code where you just knew the compiler or static analyzer was wrong, only to find out otherwise? --martyb]


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0, Troll) by aristarchus on Monday October 23 2017, @08:07AM (17 children)

    by aristarchus (2645) on Monday October 23 2017, @08:07AM (#586225) Journal

    I'm fine. And you will be, too. Just follow the logic! If your logic is incorrect, the compiler will call you out on that. Logic gates do not lie. So if you think that the compiler is full of shit, well, it has nothing to loose, and you do. This is the point of the OP.

    Now I was aiming at an analogy, not at all involving cars, that if TMB suggests that I am wrong, I should consider that possibility, much as if your compiler suggest you are full of shit, you should reconsider your coding chops: But the analogy breaks down. Nazis are just wrong, their logic is not that at all, it is hate, and ignorance, and if this is what the Mevrovingian Buzzard is suggesting we listen to, well, there is no logic in the world that could justify us doing so, and even if we do do so, well, their compiler is not compiling at all. In fact, I strongly suspect that TMB is compiling Boobies, and nothing but boobies. Sucks to have been bottle feed at such an early age.

    Starting Score:    1  point
    Moderation   -2  
       Troll=2, Total=2
    Extra 'Troll' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   0  
  • (Score: 4, Insightful) by The Mighty Buzzard on Monday October 23 2017, @10:43AM (9 children)

    by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Monday October 23 2017, @10:43AM (#586261) Homepage Journal

    Let's use your analogy then. I'm not saying you should agree with all the compiler warnings. I'm saying it's moronic beyond belief to turn them off.

    --
    My rights don't end where your fear begins.
    • (Score: 0, Informative) by Anonymous Coward on Monday October 23 2017, @01:57PM (5 children)

      by Anonymous Coward on Monday October 23 2017, @01:57PM (#586323)

      Nah, I think you're a secret little fascist hiding behind "libertarian" ideas. Your behavior fits that of the alt-right, equivocate and outright lie/troll. Pretend to be clueless, pull in some suckers, then use horribly bad logic to spread shitty world views.

      • (Score: 2, Insightful) by The Mighty Buzzard on Monday October 23 2017, @03:34PM (4 children)

        by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Monday October 23 2017, @03:34PM (#586371) Homepage Journal

        Actions speak louder than words, so they say. Check mine. Spam aside, you'll find me standing for free speech every time it's in question. That the regressive left are the only ones calling for the speech policing does not make me any flavor of "right". It just makes you the fascists you claim to oppose.

        --
        My rights don't end where your fear begins.
        • (Score: 0) by Anonymous Coward on Saturday October 28 2017, @07:43AM (3 children)

          by Anonymous Coward on Saturday October 28 2017, @07:43AM (#588603)

          the regressive left are the only ones calling for the speech policing

          [02:22:05] Bytram, Fnord666: you gotta be shitting me with the aristarchus sub
          [02:25:35] how in the fuck did we decide to run a blatant hatchet piece by the NYT, subbed by aristarchus with his own smarmy bullshit thrown in to boot?
          [02:30:44] we're seriously going to let dipshit paint half the country with his nazi brush?
          [02:32:12] fuck's sake. there are less than a hundred thousand white supremacists in the entire country of 350+ million. this is some shit i'd expect slate to run not us.
          [02:57:05] -!- TheMightyBuzzard has quit [Quit: Leaving]
          [02:57:48] -!- TheMightyBuzzard [TheMightyBuzzard!~TheMighty@Soylent/Staff/Developer/TMB] has joined #editorial

          • (Score: 2) by The Mighty Buzzard on Saturday October 28 2017, @10:13AM (2 children)

            by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Saturday October 28 2017, @10:13AM (#588627) Homepage Journal

            And? You believe getting whatever you submit on the front page is an entitlement now, eh?

            --
            My rights don't end where your fear begins.
            • (Score: 0) by Anonymous Coward on Saturday October 28 2017, @12:45PM (1 child)

              by Anonymous Coward on Saturday October 28 2017, @12:45PM (#588657)

              While The Mighty Buzzard denounces speech policing, TheMightyBuzzard indulges in it. One insists he's not an editor; the other pressures the editors concerning which stories to run.

    • (Score: 3, Insightful) by JoeMerchant on Monday October 23 2017, @09:36PM (2 children)

      by JoeMerchant (3937) on Monday October 23 2017, @09:36PM (#586595)

      I'm a believer in zero-warning compiles for release code. It doesn't solve every problem, but in my own code I see compiler warnings catching multiple bugs per year that would otherwise be getting by. On the other hand, there are some warnings in some situations that just don't mean anything valuable and can be turned off, in fact are better turned off, so as not to distract from the real warnings that mean something, and also to save the programmers from unreasonable syntactic gymnastics just to shut them up.

      --
      🌻🌻 [google.com]
      • (Score: 3, Insightful) by The Mighty Buzzard on Monday October 23 2017, @11:05PM (1 child)

        by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Monday October 23 2017, @11:05PM (#586631) Homepage Journal

        To each their own. What you call "unreasonable syntactic gymnastics" could just as well be called "doing things properly so you don't make a noobass mistake" though. Like with speech, every time you refuse to listen you eliminate the chance of finding out you're wrong and being able to correct yourself.

        --
        My rights don't end where your fear begins.
        • (Score: 2) by JoeMerchant on Monday October 23 2017, @11:52PM

          by JoeMerchant (3937) on Monday October 23 2017, @11:52PM (#586652)

          I'm o.k. with (void) casting unused variables and similar simple things, but some of the signed/unsigned warnings and other more esoteric type casting stuff can get pretty crazy looking to "do it right" when the simple, warned, code is very straightforward to read and understand.

          --
          🌻🌻 [google.com]
  • (Score: 2, Insightful) by Anonymous Coward on Monday October 23 2017, @02:54PM

    by Anonymous Coward on Monday October 23 2017, @02:54PM (#586348)

    If your logic is incorrect, the compiler will call you out on that.

    Wrong. Logic errors are exactly the type of errors the compiler is unlikely to tell you about. If you are lucky, your test suite catches them.

  • (Score: 0, Interesting) by Anonymous Coward on Monday October 23 2017, @03:15PM (5 children)

    by Anonymous Coward on Monday October 23 2017, @03:15PM (#586363)

    I'm not sure about your compiler, but your interpreter is totally messed up. TMB doesn't suggest you listen to Nazi haters, only that you shall not silence them. You are perfectly free to turn your back and change the channel. The tuner is also called a discriminator. Everybody has one. Always do the filtering at your end.

    And really, your cheap shots are so offtopic. I would mod it as such, but I don't like to downmod people. And besides, I think you're just trash talkin' to your buddies, having a bit o' fun, drawin' flies to your steaming heap. And by no means am I complaining. A bit of levity goes a long way in this sad world.

    • (Score: 0) by Anonymous Coward on Monday October 23 2017, @04:14PM (3 children)

      by Anonymous Coward on Monday October 23 2017, @04:14PM (#586386)

      What's a "tuner"?

      • (Score: 3, Touché) by maxwell demon on Monday October 23 2017, @11:24PM

        by maxwell demon (1608) on Monday October 23 2017, @11:24PM (#586644) Journal

        A misspelled big fish. :-)

        --
        The Tao of math: The numbers you can count are not the real numbers.
      • (Score: 0) by Anonymous Coward on Tuesday October 24 2017, @02:32AM (1 child)

        by Anonymous Coward on Tuesday October 24 2017, @02:32AM (#586691)

        My god! Was radio that long ago?

        But I was mistaken. The discriminator (demodulator) is after the tuner.

        • (Score: 0) by Anonymous Coward on Tuesday October 24 2017, @04:34AM

          by Anonymous Coward on Tuesday October 24 2017, @04:34AM (#586718)

          And you blame Millennials, when truly, Grandpa, it is your own memory that fails you! Do you remember when blacks knew their place? Do you remember when America was a White nation, with a White President, and a White House with a White Dog? And now all we have is an Orange President, with some ex-Commie Bimbo first Lady, and no dog! Why does the president not have a dog? So, yeah, Nazis are totally cool now, until someone threatens to "punch them in the face!" [youtu.be]

          Take it off, white boy, take it off!

    • (Score: 2, Informative) by Anonymous Coward on Monday October 23 2017, @11:32PM

      by Anonymous Coward on Monday October 23 2017, @11:32PM (#586647)

      The folks in Boston had the right idea: Outnumber them.
      They did so 40,000:50.
      The Boston cops felt it was necessary to escort the skinheads out of the area.

      Less dramatic results in Frisco, Berkeley, and Chicago back in August, but always well over 10:1 ratios.

      At the appearance of white supremacist Richard Spencer at the University of Florida on October 19, the Neo-Nazis screened out people at the door (e.g. people wearing protest T-shirts or with a lawyer's phone number written on their arms).

      They ended up with only 456 of the 700 seats occupied. [wsws.org]

      Hundreds [of Anti-Fascists still] gained entry to the auditorium, where they continuously interrupted the neo-Nazi advocate with chants such as “Go Home Nazis!, Go Home Spencer!”
      [...]
      the white supremacists were heavily outnumbered inside the venue. Only about 15 raised their hands when Spencer called on those who agree with the "Alt-Right" to identify themselves. Outside, hundreds more marched in protest, chanting "We Don't Want Your Nazi Hate", among other slogans. Spencer claimed victory but shut down the meeting 30 minutes early.

      Following the event, Spencer supporters directed gunfire into a crowd.
      No one was hit.
      2 of the perps are being held pending a $1M bond and the shooter is being held on a $3M bond.

      -- OriginalOwner_ [soylentnews.org]