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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:39:18+00:00 2026-06-11T06:39:18+00:00

I use valgrind to validate my code and it reports Conditional jump or move

  • 0

I use valgrind to validate my code and it reports “Conditional jump or move depends on uninitialised value(s)” in one of my functions, which takes an array of pointers as argument.

Now, how do I check if an array contains junk values (might be using conditional break point) during run-time? Say, I don’t access the pointer and hence the program doesn’t break.

What is the condition to be checked for to identify a junk pointer?

  • 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-11T06:39:19+00:00Added an answer on June 11, 2026 at 6:39 am

    You don’t test for junk, you put non-junk values in the array at some point between the time you create the array, and the first time you consider using the values. Usually you do it when the array is created:

    const char* strings[] = {0, "junk", "here"};
    int some_values[10] = { 0 };
    

    Valgrind uses its own tricks to identify what it thinks is junk, but those tricks are outside the scope of the standard, and regular C code can’t use them (or anyway shouldn’t try). Even if you could somehow hook into what valgrind does, you’d end up with code that doesn’t work on all implementations, or that only works when run under valgrind.

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

Sidebar

Related Questions

After writing thousands of lines of code I use valgrind and am horrified to
Valgrind is showing an uninitialised value of size 8 error. And occasionally, the below
Can you please tell me how can I use valgrind for memory profile? The
I have not used valgrind before, but I need to use it to check
use Modern::Perl; use Algorithm::Permute; use List::AllUtils qw/uniq/; find_perms(1151); sub find_perms { my ($value) =
valgrind is reporting uninitialized memory errors from code like this: unsigned char buf[100]; struct
I am getting a strange error with valgrind on a program that makes use
I wrote some C++ code in which I used Templates. Since I used templates,
I use valgrind to debug my application. I have two machines where I want
I use valgrind to find out a confused problem of the direction of stack.

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.