Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

warning C4090

Posted on 2006-07-14
8
Medium Priority
?
1,373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

597 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