Solved

warning C4090

Posted on 2006-07-14
8
1,348 Views
Last Modified: 2012-05-05

Hello,

I got the following error: warning C4090: '=' : different const or volatile qualifiers

anyone knows why?

Thanks
0
Comment
Question by:TungVan
  • 4
  • 4
8 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 17108640
you're trying to assign a variable with the const or volatile qualifier to a variable that doesn't have that qualifier.

Check here for more info :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/C4090.asp
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 17108647
Can you show the code that generates the warning, as well as the definitions of the variables used in that line ?
0
 

Author Comment

by:TungVan
ID: 17108722

void AddBSMaybe(LPSTR pszPath)
{
      int nPos;

      nPos = lstrlen(pszPath)-1;

      /* if no backslash, then add one */
      if(pszPath[nPos] != '\\')
            lstrcat(pszPath,"\\");
}
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:TungVan
ID: 17108735
void DelBSMaybe(LPSTR pszPath)
{
      int nPos;

      nPos = lstrlen(pszPath)-1;

      /* if backslash, then zap it */
      if(pszPath[nPos] == '\\')
            pszPath[nPos] = 0x00;
}

BOOL DoDirVerify(LPSTR pszPath, LPSTR pszDirName)
{
      char szPath[MAXPATHLENGTH]={0};

      lstrcpy(szPath,pszPath);

      if(pszDirName != NULL)
      {
            /* add sub-dir name */
            AddBSMaybe(szPath);
            
            lstrcat(szPath,pszDirName);
            
      }
      
      DelBSMaybe(szPath);
      
      /* check for existence and return */
      return (! _access(szPath,00));            
}
0
 

Author Comment

by:TungVan
ID: 17108743

I also get error: error C2057: expected constant expression

in the DoDirVerify function
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 17108792
At what line does the warning occur ? Because I don't see anything wrong here that could trigger this warning.
0
 
LVL 53

Accepted Solution

by:
Infinity08 earned 50 total points
ID: 17108857
>> I also get error: error C2057: expected constant expression
That's because the _access() function expects a const char* as first argument :

http://msdn2.microsoft.com/en-us/library/1w06ktdy.aspx
0
 

Author Comment

by:TungVan
ID: 17108994

sorry for the C4090 warning. It happens in another function coded before AddBSMaybe()

Thanks for your help
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question