Has anyone ever seen a function call just get skipped? I am running in debug mode and it wont let me set a break point on the call and when i step to it it goes right over to the next line, no exceptions, no errors. Has anyone EVER seen this before? Thanks.

Recommended Answers

All 8 Replies

please post the relevant section of code

Perhaps the compiler has statically determined that the code can never be called, and has thus removed it.

But as jesseb07 says, we need code.

It is really basic code, a while(1) in a thread, that calls a function. I have even tried copying and pasting the contents of the function and it skips all that. Tried cleaning, you name it ive tried it. It has to be something within the compiler. I appreaciate your inputs, i will look into what you brought up salem.

You seem to have used a really small font with the code.
Can you post it larger please?

Perhaps your compiler decided to optimize the code by substituting the contents of the function for the function call as if the function were declared inline.

Ok, this is a long-shot but it may be possible to prevent the optimization by marking the modifier entering the function as volatile.

Again, I have no idea because this is something an individual told me about in class (since I didn't think code could EVER be skipped unless it was a condition, but apparently it can?), and also because we have no clue what your code looks like at the moment.

If I'm wrong, please correct me. I was stating this as a possibility without any real research behind it.

But at the moment, you're shooting wind at us - show us the code.

May be this function is infected by extremely malicious stealth virus which is capable to hide not only its binary image but source code too...

commented: That was hilarious! +2

The problem had to do with the optimization. Once I took it from "maximize speed" to "no optimization" it worked fine. Dont know how that effects everything optimization wise, but for now it will do. Thanks guys.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.