Results 1 to 4 of 4

Thread: Error : Vmin unused variable

  1. #1
    Join Date
    Apr 2009
    Posts
    79

    Error : Vmin unused variable

    I wondered why my program does not recognize the variables that I declare, I have an error message " 'Vmin' unused variable" and Vmin was not declared in this scope " it is two contradictory messages, could you please explain this, thank you.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Error : Vmin unused variable

    Is there a tool which can be used to optimize the code and also to find which all part of code is dead code( like some invalid if condtion which may never happen ),If you're using Visual Studio.Net, yes. It will tell you every time you compile.

  3. #3
    Join Date
    Apr 2009
    Posts
    79

    Re: Error : Vmin unused variable

    Code:
    Vmin = double F (10, 300); 
      Double Vmax = 0; 
      double V; 
    	  for (s = 1, s <= numItems; s + +) 
    		  ( 
    
    
    			  V = on_Num (s); 
    
    			  if (V <Vmin) 
    			  ( 
    			    Vmin = V; 
    			  ) 
    
    			  if (V> Vmax) 
    			  ( 
    			   Vmax = V; 
    			  ) 
    
    		  ) 
    
    	  cout << "MAX" on Num' "<<Vmax <<endl; 
    	  cout << "MIN" on Num' "<<Vmin <<endl; 
      <Error> </ error>

  4. #4
    Join Date
    Jan 2009
    Posts
    199

    Re: Error : Vmin unused variable

    If variable <variable_name> or function <function_name> is not used, it can be removed. Any compiler warning is automatically treated like an error and the build will fail. If it is only used sometimes, you can use __attribute__((unused)). This attribute suppresses these warnings. For example:
    Code:
    int  __attribute__ ((unused)) functionname(int parm1, long parm2) { … }
    long __attribute__ ((unused)) variablename;

Similar Threads

  1. Syntax Error for a variable named checked in Csharp
    By KANAN14 in forum Software Development
    Replies: 3
    Last Post: 17-11-2009, 01:58 AM
  2. Replies: 2
    Last Post: 28-08-2009, 07:51 PM
  3. Replies: 3
    Last Post: 25-04-2009, 11:34 AM
  4. Undefined variable error in Php
    By Capers in forum Software Development
    Replies: 3
    Last Post: 31-03-2009, 05:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,561,792.73056 seconds with 17 queries