False warning C4389 with Microsoft compiler

 UINT uLong = 0;
 WORD byVal = 1;
 WORD byVal1 = 3;
 if (uLong != (byVal * byVal1))
  printf("Correct");
 else
  printf("Incorrect");
Above code gives me "warning C4389: '!=' : signed/unsigned mismatch"
As all the variables involved in expression are unsigned how can it result in this warning. BTW this happens only on Microsoft compiler and not on GCC.
Is it a bug in Microsoft compiler, if not can anyone let me know how to fix this in my code?
I am using Microsoft Visual Studio Premium Version 12.0.21005.1 REL.
Thanks & Regards,
Amit Kulkarni.

"But reading it carefully it looks like a guideline and not the rule. It says  "can be"
so it's not compulsory."
Yes, integral promotions aren't compulsory. But in this particular case they are, see the standard quotes provided by Igor Tandetnik.
And it seems that you have missed the "otherwise" part:
"can be converted to a prvalue of type int if int can represent all the values of the source type; otherwise, the source prvalue can be converted to a prvalue of type unsigned int"
Given that all "unsigned short" values can be represented by "int" there's no way this text would allow conversion to "unsigned int".
"Why compiler need to convert it to a signed value when originally it is unsigned?"
Why wouldn't it do that? How is promoting to "unsigned int" better than promoting to "signed int"?
The C89 Rationale document mentions this debate and gives a (not very detailed) reason for this choice:
"The unsigned preserving rules greatly increase the number of situations where unsigned int confronts signed int to yield a questionably signed result, whereas the value preserving rules minimize such confrontations.   Thus, the value preserving
rules were considered to be safer for the novice, or unwary, programmer.   After much discussion, the Committee decided in favor of value preserving rules, despite the fact that the UNIX C compilers had evolved in the direction of unsigned preserving."
In short, "signed int" was deemed to be more common than "unsigned int".
Interesting facts about other languages:
C# follows the same rule but avoids the signed/unsigned comparison issue by promoting both operands to long. And if you try to compare long with ulong it gives up and rejects the code.
Java doesn't have this issue to begin with, it doesn't have unsigned integral types.

Similar Messages

  • Be Warned - Mavericks is not compatible with Microsoft Office 365!!!!!!!!!!!!!!!

    Be Warned - Mavericks is not compatible with Microsoft Office 365!!!!!!!!!!!!!!! 
    I upgraded to Mavericks on 4 seperate computers, an 2 iMacs, MBPro and an MBAir and ALL four no longer connect to Microsoft Office 365 email accounts either with Office 2011 or the built in Mac apps.  Apple support says "Microsoft knew for a year that Mavericks was coming out and it their job to make it compatible".  I repsonded that their own Apps like Mail, Contacts and Calendar don't work either and they attempted to trouble shoot those apps only to no avail after 4 hours and a Mavericks reinstall.  I have also tried an Office reinstall.
    Right now I am no where, stuck between two companies who say it's the other guys fault......

    Me again:
    A colleagues more formal description of the problem:
    We have had a major problem with people working directly off of the afp reshares with MS Word.
    Word creates "Word Work Files" and usually is able to store them in either "Share/Temporary Items/uid/TemporaryItems/" or "Share/.TemporaryItems/folders.uid/TemporaryItems" as long as permissions are correct.
    This works under 10.5.7 seed release 9J39 with direct attached storage, but with the Xsan reshared the word work files appear in the same folder as the opened document even though the permission for temporary items are correct.
    This causes a number of issues, one being that if one user has a document open and another clears out the word work file then the open document cannot be saved.
    Another issue that we have seen is where the word work file is created and then the original document disappears (although I think this may be another user housekeeping the word work files again).
    We have tried to persuade users to work on local copies of the documents instead, but old habits die hard...

  • Integrating IBM Personal Communications for Windows with Microsoft Office

    Hello,
    I am a self taught programmer and I use COM objects to integrate IBM Personal Communications with Microsoft Office.   VBScript is used to perform internal automations of the IBM product as well as integrate it with Outlook and Excel. 
    Instead of buying an e-mail product for the AS/400, I just have Personal Communications send e-mail from Outlook.  Instead of creating a spreadsheet application in Java, I integrate Excel with Personal Communications. 
    Having a Technet section that showcases integrating Microsoft products with Personal Communications to enhance it would be desirable. Any ActiveX examples in Personal Communications have to be re-engineered to work with VBScript because they are coded in Visual Basic.
    For example, VBScript can be used with Personal Communications; but, Visual Basic is used with Microsoft Office applications. 
    Because Personal Communications has limited windows interfaces, I use HTML applications to create more feature rich windows interfaces with Personal Communications when I want more complexity than either an input or a message box from VBScript.
    Although HTML applications are old technology, they are easy to create and can utilize all the functionality of MSIE to use VBScript, Javascript, C#, Java, HTML, DHTML, and CSS.  However, I generally only need VBScript, HTML and CSS.
    MSDN2 has HTML applications, CSS, and VBScript in separate sections; but, it does not have a section that shows how everything can be used together. 
    Have a great Day!
    Jesse Grune. 
     Jesse Grune

      Anything can be hacked; however, when I want to get a job done fast I write my own automation and execute it instead of filing a request for IT to write an interal system upgrade.
    For example, say I want to have my computer talk for me because I cannot talk at the moment. What I can do is use the speech capabilty of Microsoft Excel and add it as a feature of an automation. 
    [PCOMM SCRIPT HEADER]
    LANGUAGE=VBSCRIPT
    DESCRIPTION=Have the computer talk
    [PCOMM SCRIPT SOURCE]
    OPTION EXPLICIT
    autECLSession.SetConnectionByName(ThisSessionName)
    REM This line calls the macro subroutine
    subSub1_
    Sub subSub1_()
    dim myexcel
    Set myexcel=CreateObject("Excel.Application")
    dim string
    string = Inputbox("What do you want to say?")
                        myexcel.Application.Visible = False
                        myexcel.Speech.Speak string
                        autECLSession.autECLPS.SendKeys "[reset]"
                        set myexcel = Nothing
              End Sub
    If I want it to read the page to me, I can have it copy a section of a screen or set of screens and then read the data to me.  Also, I use a slight modification of the above code to allow me to write to an Excel file for hidden or visible tracking of what an associate is doing. The hidden tracking is for supervisor or managerial back end review.
    If I want to send e-mail, I Include the following code in a VBScript automation file:
             dim myOLItem, Mail
             set Mail = CreateObject ("Outlook.Application")        
             Set myOLItem = Mail.CreateItem(0)
             myOLItem.To = "Some e-mail in quotes"
            myOLItem.CC = "Some other e-mail in quotes"
            myOLItem.Subject = "A subject in quotes"     
            myOLItem.Body =   "The message body in quotes"
            myOLItem.Display
    Using CreateObject, I am able to use features of almost any progam on my desktop and have them as features in my automation.  Aslo, I can borrow features of other programming languages on my computer and use them in VBscript.
    If I wanted to add some level of security to my scripts I could have a check file that verifies my automations are secure; but, that would be a pain to maintain unless I add artificial intelligence to the program. 
    Because of security features in Outlook, I directly type my closing rather than pull my name as the current user because I don't want to bother with the popup box that my automation is hacking my address book. 
    There are some programs at work that data is typed into from the Client Access Emulator; and, if I had the time to scrpt code and the obect model of the program, I could automate that work and put a lot of people out of work.    
    Anyone that can write up cooking directions and follow them, can write a program. Debugging the program to work with a compiler or the quirks of another program from which the automation is being executed is similar to modifying a recipe depending on the cooking conditions.
    Have a great Day!
    Jesse Grune.
    Jesse Grune

  • Linking oraocci11.dll - OCCI works only with Microsoft VC++???

    I wonder if OCCI will work with other IDEs too?
    I tried to use it with MingW Toolchain (g++). But I could link the dll to my application yet. When compiling I get always:
    g++ -IC:\oracle\11.1.0\oci\include -IC:\oracle\11.1.0\oci\lib -O0 -g3 -c -fmessage-length=0 -oOcciTest.o ..\OcciTest.cpp
    g++ -LC:\oracle\11.1.0\BIN -LC:\oracle\11.1.0\oci\lib\msvc -oOracleTest.exe OcciTest.o -loraocci11
    OcciTest.o: In function `main':
    N:/workspace/c/OracleTest/Debug/../OcciTest.cpp:27: undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'
    collect2: ld returned 1 exit status
    Build error occurred, build is stopped
    How to link the dll (oraocci11.dll?) correctly?
    Client: 11.0.6
    DB: 9i
    OS: WinXP
    IDE: Eclispe CDT
    Comp: G++
    Edited by: [email protected] on Mar 12, 2009 9:33 AM

    Hi,
    You need the correct version (lib and dll) for your specific compiler.
    Look here:
    Link:[Using OCCI with Microsoft Visual C++(11gR1)|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28390/install.htm#CBHGBBJI]
    Or here, to download other versions for VC++9(2008)
    Link:[Oracle C++ Call Interface - Downloads|http://www.oracle.com/technology/tech/oci/occi/occidownloads.html]
    hth
    P

  • Sun Studio 11 Warning raised after new compiler upgrade

    Hi All,
    I have an issue regarding the warning raised by new complier upgrade.
    Sun Studio 11 is the product and OS is Solaris 8.The following are the warning messages after successful compilation
    1. Warning: declarator required in declaration
    2. Warning: Last line in file "../inc/bibbnote.h" is not terminated with a newline
    Please advise me on the above issue wheather the above warnings can be ignored.
    Regards
    Vinoth
    Message was edited by:
    vinothsankar

    Those lines are not valid C++, since no typedef name is provided. Sun C++ accepts them as an extension, but issues a warning because the code is not valid.
    Examples:
    typedef int Int;
    Int is declared to be a synonym for int.
    typedef int;
    Invalid: no name is provided as a synonym for int.
    enum Foo { a, b, c};
    Foo is declared to be an enumerated type with enumerators a, b, c.
    Typedef Foo Bar;
    Bar is declared to be a synonym for Foo
    typedef enum { d, e, f } E1;
    E1 is a synonym for the unnamed enumerated type with enumerators d, e, and f. This is a C style declaration, which serves no useful purpose in C++.
    typedef enum E2 { g, h, i } E3;
    E2 is declared to be an enumerated type with enumerators g, h, i, and a synonym E3.
    typedef enum E4 { j, k, l };
    Invalid declaration. No name is provided as a synonym for E4. Remove the "typedef" and you have a valid declaration of E4 as an enumerated t ype.
    References: C++ Standard, sections
    7.1.3 The typedef specifier
    7.2 Enumeration declarations

  • A project which specifies SQL Server 2012 as the target platform may experience compatibility issues with Microsoft Azure SQL Database.

    Hello
    When I try to publis my asp.net application in azure, i have the next error:
    >C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4253,5): Warning : A project which specifies SQL Server 2012 as the target platform may experience compatibility issues with Microsoft Azure SQL Database.
    >C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4253,5): Warning : The project and target databases have different collation settings. Deployment errors might occur.

    Hello
    When I try to publis my asp.net application in azure, i have the next error:
    >C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4253,5): Warning : A project which specifies SQL Server 2012 as the target platform may experience compatibility issues with Microsoft Azure SQL Database.
    >C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4253,5): Warning : The project and target databases have different collation settings. Deployment errors might occur.
    Hello,
    This forum is to discuss vb.net issues, your issue is mainly regarding Azure SQL Database, I found that you have posted another thread in that forum
    https://social.msdn.microsoft.com/Forums/azure/en-US/f435921a-14d1-4441-8b2b-32ba3d937aea/a-project-which-specifies-sql-server-2012-as-the-target-platform-may-experience-compatibility-issues?forum=ssdsgetstarted#f435921a-14d1-4441-8b2b-32ba3d937aea.
    I would recommend you focus on that thread to get help.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • DPM integration with Microsoft Azure backup queries

    Hi All,
    We have made the test set-up environment with installed the below details
    DPM 2012 R2 on VM (Windows 2012 R2)
    We are using a raw disk of 200 GB for disk staging.
    DPM integrated with microsoft azure.
    Able to take file backup and databases backups from DPM and can perform the restore from Disk staging as well as from azure
    Queries:
    Will DPM support deduplication for exchange (2007,2010,2013) databases and for sql databases (2000, 2005,2008,2012,2014) ?
    on the wire compression is enabled but how to verify that?
    Is it possible to mount the raw disk to some other drives except local Disk (C:\)
    How to do granular recovery in DPM 2012 R2 for microsoft exchange?

    Chris,
    Really sorry for the delay in response.
    I found lots of warning messages in the logs like below one:
    578    788    24-Apr    20:49.7    18    readeriterator.cpp(587)    [000000002435A140]    0BABF215-19DF-49F5-B8DF-7210CB336DD5    NORMAL  
     "CFileReaderIterator:GetNextFileReader -> Skipping Hardlink with Physical FilePath: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy34\Windows\WinSxS\amd64_microsoft-windows-i..l-keyboard-0001042b_31bf3856ad364e35_6.2.9200.16384_none_f8e4c1f6d2951dd3\KBDARMW.DLL,
    Logical FilePath: \\?\Volume{bd3973d0-2f82-11e4-93f6-806e6f6e6963}\Windows\WinSxS\amd64_microsoft-windows-i..l-keyboard-0001042b_31bf3856ad364e35_6.2.9200.16384_none_f8e4c1f6d2951dd3\KBDARMW.DLL"
    578    788    24-Apr    20:49.7    18    readeriterator.cpp(587)    [000000002435A140]    0BABF215-19DF-49F5-B8DF-7210CB336DD5    NORMAL  
     "CFileReaderIterator:GetNextFileReader -> Skipping Hardlink with Physical FilePath: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy34\Windows\WinSxS\amd64_microsoft-windows-i..l-keyboard-0001042e_31bf3856ad364e35_6.2.9200.16384_none_fa395780d1ba2b68\KBDSOREX.DLL,
    Logical FilePath: \\?\Volume{bd3973d0-2f82-11e4-93f6-806e6f6e6963}\Windows\WinSxS\amd64_microsoft-windows-i..l-keyboard-0001042e_31bf3856ad364e35_6.2.9200.16384_none_fa395780d1ba2b68\KBDSOREX.DLL"
    So, I'm checking with concerned guys in here about this. I'll get back to you once I receive any update from them.  However, if it very urgent and need immediate assistance, I suggest you to open up a support ticket with Azure technical Support team
    as they will be able to provide you very quick solution.
    Regards,
    Manu

  • Compatibility issues with Microsoft Office?

    I am planning to buy a 13"MBA - Are there any known issues with working with years of files generated with Microsoft Office?
    Any suggestions?
    Many thanks

    The only problem you might run into is when opening MS Word documents that are in a very old (i.e. pre-2003) versions.
    UNLIKE trying to open a pre-2003 document in say, Office 2010 on Windows, you won't have to jump through hoops and recite arcane incantations to get it to open.  In OS X, if you try to open the docs by directly clicking on them in the finder, you'll get a warning message and they will not open directly, but all you have to do is open them from the File menu from within Word.

  • When i login with microsoft account cannot access with administrative share c$

    i have a problem when i login to windows with microsoft account cannot access any network computer with administrative sharing c$,d$ with windows 8.1 
    but when i login with local account can access
    and some people tell  me create key in regedit t fix it 
    after enter user name and password show this error 
    and i apply your instruction  and not fix until now
    note:
     my Machine windows 8.1 if another machine in network windows 7 can access a hidden share if machine in network windows 8.1 show this message in image 2 
    but if i login with local user can i access all machine hidden share network windows 7 and 8.1

    yes this computer i want to access  name poland2-work and have two users 
    first :administrator
    second : poland 2

  • Is there a way to create form fields to tab into and type and or drop down selection fields in pages as you can with microsoft word?

    is there a way to create form fields to tab into and type and or drop down selection fields in pages as you can with microsoft word?

    No

  • Does iWork come with a form of powerpoint presentation compatible with Microsoft Office Powerpoint?

    I recently bought a MacBook Pro and need to purchase iWork or Microsoft Office. Does iWork come with a form of powerpoint presentation? If so, is it easy to use and compatible with Microsoft Office presentation software? The latter question is extremely important as we use Microsoft Office primarily at the college.

    Yes, Keynote is iWork's PowerPoint equivalent. You can save as a PowerPoint file as well. Very easy to use IMO.

  • Unit Testing with Microsoft Sharepoint Emulators and Fakes with Visual Studio 2013

    Hi All,
    I have created Test Project and now creating Test cases for Sharepoint. I found a link on MSDN which suggests using Fakes framework but it supports VS2012 and I am using Visual Studio 2013.
    So how can I use it with VS2013 or is there any other way with which I can implement the Test cases with VS2013.
    Please suggest.
    Thanks in advance.
    Himanshu Nigam

    Hi HimanshuNigam,
    According to your descrition, my understanding is that you want to use Fakes framework to create test case for SharePoint project in Visual Studio 2013.
    If you want to test using Fakes Framework, you can use the codeplex extension to achieve it. It supports Visual Studio 2013.
    Here is a detailed article for your reference:
    Better Unit Testing with Microsoft Fakes
    About how to include the Nuget package, you can use the package with the link below:
    NuGet Package Manager for Visual Studio 2013
    Installing NuGet
    If you still have question about this issue, I suggest you can create a post in Visual Studio, more experts will help you and you can get more detailed information from there:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=visualstudio%2Cvsarch%2Cvsdbg%2Cvstest%2Cvstfs%2Cvsdata%2Cvsappdev%2Cvisualbasic%2Cvisualcsharp%2Cvisualc
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • A datasheet component compatible with Microsoft Sharepoint Foundation 2010 is not installed error

    I have 2013 Office installed and using 2010 SharePoint Foundation.
    The button 'Datasheet View' is available on the site but when clicked on I get this error:
    The list cannot be displayed in Datasheet view for one or more of the following reasons:
    - A datasheet component compatible with Microsoft SharePoint Foundation is not installed.
    - Your Web browser does not support ActiveX controls.
    - A component is not properly configured for 32-bit or 64-bit support.
    I have installed and repaired the Office Suite already, ActiveX is enabled in the browser etc.
    I have also enabled the Microsoft Add-ons.
    Installed on Windows Server 2008 R2.
    How can I solve this issue?

    Hi,
    1. The Edit
    in Datasheet view functionality in SharePoint Server 2010 is not supported if you install
    64-bit Office 2013 client. The Edit in Datasheet functionality
    is available if you install 32-bit Office 2013 client
    http://technet.microsoft.com/en-us/library/ee681792.aspx
    2. Edit in data sheet view is not supported in 64 bit version of the i.e.
    If I understand correctly you are trying to access site from the Windows server 2008 R2, the default OS installation will have two browsers. Open internet explorer that doesn't have (64 bit) in the bracket. The one with 64bit is not supported
    http://office.microsoft.com/en-us/sharepoint-foundation-help/use-datasheet-view-in-64-bit-office-2010-HA101882420.aspx
    Regards Murali

  • Error An unexpected error has occurred. Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: 65ef1cb8-1cbf-40ee-b79b-05db15ca6dbb

    Hi, 
    Since I installed a few updates, that I can't access the sharepoint the same way. I always get errors when trying to access the majority of the pages.
    I already removed the update suggested on other threads (KB2844286), but everything remains the same.
    I always receive errors like this one:
    Error
    An unexpected error has occurred.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: 65ef1cb8-1cbf-40ee-b79b-05db15ca6dbb
    what can I do? The Sharepoint 2010 is located on a virtual partition of our server, running Windows Server 2008 Standard edition SP1.
    When I try to access administration tools it happens the same error, and I don't know what I can do more. 
    Please help me.
    best regards,
    Jorge Guimarães

    I followed some tips, to trace the error, allowing some trace debug, and got this:
    Server Error in '/' Application.
    Object reference not set to an instance of an object.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
    Source Error: 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace: 
    [NullReferenceException: Object reference not set to an instance of an object.]
    Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties() +134
    Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs() +44
    Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext) +329
    Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalAvailable() +44
    Microsoft.Office.Server.WebControls.MyLinksRibbon.EnsureMySiteUrls() +60
    Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalMySiteUrlAvailable() +15
    Microsoft.Office.Server.WebControls.MyLinksRibbon.OnLoad(EventArgs e) +91
    System.Web.UI.Control.LoadRecursive() +65
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427
    Version Information: Microsoft .NET Framework Version:2.0.50727.5477; ASP.NET Version:2.0.50727.5479

  • Sign in with Microsoft account not responding

    I have problem with skype sign in with Microsoft account. When I click on sign in with Microsoft account, in version 7 skype freezes and not respond and in version 6 it stays in loading and not respond. I tried to uninstall completely and reinstall, delete the share.xml and all of the available solutions. None of them have worked! It's worth to mention that I have no problem with Android version.

    Please,  run the DirectX diagnostics tool.
    Go to Windows Start and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post.
    Be aware that you will have to zip this file before attaching it here.

Maybe you are looking for

  • Change display value of "select list"

    Hi! I have a problem with a select list, I want to change the display value through an own pop up (page 5 of apex application) after I submit in it. The select list is based on a sql query: select A_NAME display_value, A_ID return_value from APPLICAT

  • "cannot be modified" error

    I go to "Connect to Server" and connect fine and can read all of the files, but cannot write to the server. I am running 2 machines, one windows - one mac, and would like to run mac exclusively, however I need to go to my windows machine just to tran

  • Live muse site defaults to tablet when on desktop

    I have just published my site to my hosting provider but it keeps showing the tablet version of the site instead of the desktop. I'm reluctant to delete the tablet (and possibly phone) versions but how do I get it to show the right site on the deskto

  • HT204291 An error occurred (-6727) while connecting to the AirPlay device "Apple TV"

    this is the message i get when trying to mirror with the new mountain lion. everything is switched on airplay works with my ipad nut will not connect through the mac does anyone have an answere please

  • Killer issue : OBIEE server hits the session cursors or chance.

    Hi, We have seen a killer issue. We tested a report & saw some data on it, immediately for testing we deleted the data from the backend & again ran the report by clciking on the go button & we saw the same data though the data was delted from the DB.