This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Some lines are skiped on the debug

Hi, Excuse my english. IÂ'm a begginer on C. Some times, when my program donÂ't run well and I check on the debugger, I can see that some lines are skiped (when on the side is not in dark grey), I think that thoose lines are skiped on the compiler process. I change data types, and some others things, but without results. No errors or warnings appear on the compiling and linking process. I try to change the memory model but with same result. Can somebody help me ?. Thank you

  • If you have specific code, you may post sections of the code here together with mentioning which lines gets skipped.

    But there are a couple of things to think about.
    - If having code optimization turned on, the compiler may performing significant rewrites and rearangements of the code. It will produce something that gives the same end results, but since the code no longer has a 1:1 relation with the source code, the debugger will not be able to mark each individual source lines as processed.

    - If you have code that does not produce any real results, then the compiler can throw away some actions. If you make assignments to a local variable, but never makes use of the result, there will be no need to perform the assign in the first place. Making an assignment to the variable and then reading the variable without using the variable value to produce any side effect means that both the assign and the read can be removed. Complete loops can be thrown away if the loop does not produce any side effect making it meaningful.