?
Solved

warning C4090

Posted on 2006-07-14
8
Medium Priority
?
1,364 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

765 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