Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. How to increment a variable [modified]

How to increment a variable [modified]

Scheduled Pinned Locked Moved The Weird and The Wonderful
tutorial
22 Posts 8 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Tom Delany

    "Oh, I see by your variable name that you intended this to be an unsigned imaginary number. Level of certainty: 95%" That's not actually what the output said, but that's an example of the kind of thing that I imagined the compiler saying that as it was processing the code. I do seem to recall it giving some kind of "level of certainty".

    We are dyslexic of Borg. Refutance is systile. Your a$$ will be laminated!

    R Offline
    R Offline
    Robert Surtees
    wrote on last edited by
    #21

    That's right. It was somewhat conversational with a hint of arrogant superiority. You wrote "this" (you bonehead). PL/C chooses to do "this". If smileys had been invented then I'm sure it would have followed with a :P

    1 Reply Last reply
    0
    • L Lost User

      It was in release mode of course otherwise it's only normal that it wouldn't do any optimizations :) Ok didn't think of volatile - well then "any variable or field that is not volatile" can have an assignment to itself removed without any harm (unless you're doing scary reflection tricks..) But the JIT compiler is a problem.. how can you see what code it produces?

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #22

      I don't like to think what would happen to "i = i++" if "i" is truely volatile. Would the post increment be actioned on an interrupt modified value? Now that would be a good bug to find!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups