Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8299197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:04:22+00:00 2026-06-08T16:04:22+00:00

My coworker just asked me to help on a problem, he has a few

  • 0

My coworker just asked me to help on a problem, he has a few lines in his code as

for (long counter = 0; counter < End; )
{
  ...
  assert(counter++ < MAX);
  ...
}

The problem is, when we use Visual Studio to debug line by line, seems the assert() line got skipped all the time, and counter never got incremented and thus the loop never finished.

When we look at the disassembly using VS, there is no assembly line for this assert() function. I never used assert() before, so I’m wondering is this normal and he shouldn’t put any code behavior into assert() or something is wrong here with debugger or other?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:04:23+00:00Added an answer on June 8, 2026 at 4:04 pm

    Make sure that NDEBUG is not defined, as assert is enabled only in debug build, i.e when NDEBUG is not defined.

    From here:

    #ifdef NDEBUG
    #define assert(condition) ((void)0)
    #else
    #define assert(condition) /*implementation defined*/
    #endif
    

    That is, when NDEBUG is defined, assert is no-op which is what you observe in assembly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just had a discussion with a coworker concerning code in header files: He
My coworker has an issue where his commits keep including every single file in
A coworker just asked me if there were any reason why referring to images
A coworker has been struggling with this problem. The desired result is an installable
my co-worker has just create a new branch in the git repository which we
My coworker suggested making several of the Eclipse code-formatting and warning settings to be
A coworker recently showed me some code that he found online. It appears to
A coworker just installed Visual-Studio-2010 Premium from MSDN. The install acted like it worked
I'm trying to help a coworker get something compiled - essentially, he was trying
A coworker asked me today how to add a range to a collection. He

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.