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 8287443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:02:32+00:00 2026-06-08T12:02:32+00:00

Very frequently, I want to test the value of a variable in a function

  • 0

Very frequently, I want to test the value of a variable in a function via a breakpoint. In many cases, that variable never actually gets referenced by any code that “does stuff”, but that doesn’t mean I don’t still want to see it. Unfortunately, the optimizer is working against me and simply removing all such code when compiling, so I have to come up with convoluted grossness to fool the compiler into thinking those values actually matter so they don’t get optimized away. I don’t want to turn the optimizer off, as it’s doing important stuff in other places, but just for this one block of code I’d like to temporarily disable it for the sake of debugging.

  • 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-08T12:02:33+00:00Added an answer on June 8, 2026 at 12:02 pm

    Code the produces observable behavior fits the requirements by definition. For example, printf("").

    Access to volatile variable also formally constitutes observable behavior, although I won’t be surprised if some compilers still discarded “unnecessary” volatile variables.

    For this reason, a call to an I/O function appears to be the best canditate to me.

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

Sidebar

Related Questions

I have a MySQL table that's being updated very frequently. In essence, I'm trying
I have some data layer classes that are to be used very frequently almost
I have some old Haskell code that includes QuickCheck test cases. Newer versions of
Often I need to minimise object allocations within code that runs very frequently. Of
I find myself very frequently wanting to write reusable strings with parameter placeholders in
I am working on optimizing a query which is used very frequently on our
I frequently upload CSV files to a MySQL db. It is very convenient to
Very simple question: Specifically in Python (since Python actually has strongly recommended style guidelines
I'm planning to write an interactive C++ geometry processing plug-in that will frequently sort
I have an ASP.Net 4.0 web application which very frequently loads data from the

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.