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

  • Home
  • SEARCH
  • 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 6327993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:22:45+00:00 2026-05-24T17:22:45+00:00

I have been getting following warning while compiling the C source code in the

  • 0

I have been getting following warning while compiling the C source code in the gcc 4.6.1.

   warning: variable set but not used [-Wunused-but-set-variable]

I refered to this link Wunused but could get exactly what is causing this warning.Would anybody tell me in more details what is causing this warning and how can We get rid of it?

[EDIT]
I have a following snippet of code. The compile shows the above mentioned warning. Could you please suggest me how can correct it?

   test_function(){
   BOOL BoolTest;
   BoolTest = test_fucntion2();

   #ifdef CHECK
   if (!BoolTest) {
   misc_StartErrorReport();
   misc_ErrorReport("\n test_function2: Input not indexed.\n");
   misc_FinishErrorReport();
          }
   #endif
   // 
    BoolTest is no more used below it.
   // } 
  • 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-05-24T17:22:45+00:00Added an answer on May 24, 2026 at 5:22 pm

    You need to include the preprocessor guards around the declaration and initialisation of BoolTest:

    test_function()
    {
    #ifdef CHECK
        BOOL BoolTest = test_function2();
    #else
        test_function2();
    #endif
    
    
    #ifdef CHECK
        if (!BoolTest) {
            misc_StartErrorReport();
            misc_ErrorReport("\n test_function2: Input not indexed.\n");
            misc_FinishErrorReport();
        }
    #endif
    

    (this assumes that you still want to call test_function2() even if CHECK is not defined, presumably for its side-effects – if not, then you don’t need the #else section and you can combine the two #ifdef blocks into one).

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

Sidebar

Related Questions

I have been getting an error in VB .Net object reference not set to
I have been getting the following exception: The binary operator GreaterThanOrEqual is not defined
On several of my adsense running sites, I have been getting the following errors:
I have been using Visual Studio 2008 quite long but lately I am getting
I'm running Visual Studio 2005 Pro, and have been getting the following error recently:
I'm a PHP dev and I'm new to Rails but have been getting on
I'm very new to Ruby on Rails, and have been getting the following error
I am getting the following messsage in System out: FacesMessage(s) have been enqueued.... .
I have been getting a number of attacks on my website lately, with a
I have just been getting into low level programming (reading/writing to memory that sort

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.