False alarm: the compiler bug?

This happens with CVI 2010 SP1.

Compiling this code, I get "WARNING: Conversion from '__int64' to 'long' could lose data... ' on the 'z = y' line.

Please note this line does not have any variable __int64.

More strange: if I comment any line of the "case", the warning disappears: the warning when are present four or more instructions "box.

However, the generated code works perfectly, to a quick test.

#define A 0x00000000
#define B 0x00000001
#define C 0x00000002
#define D 0x00000003

#define MASK 0x00000003

void CompilerBug()
{
__int64 x=0;

int y,z;

    switch(x & MASK) {
        case A: y=0; break;
        case B: y=1; break;
        case C: y=2; break;
        case D: y=3; break;
    }
    z = y;
}

I will be happy if someone can confirm this behavior.

Thank you

At first glance, the warning seems to be false. The conversion from __int64 to long don't actually takes place. Instead, case expressions are converted long __int64. The behavior of the switch statement seems correct and therefore the warning can be ignored.

We have not yet investigated the cause of this error, but you can follow the matter with bug ID 363456. In the meantime, it would be more prudent to ensure that your switch expression and case expressions are of the same type where we have not fully defined errors.

Tags: NI Software

Similar Questions

  • The compiler bug? Var statement above the postcedes function being called external execution function definition

    Use Flash CS5 (AIR and, although this does not seem that it would be AIR bound) in Win XP 64


    I have a MovieClip symbol in my library with the identifier 'Puzzle10Piece10' with the following actionscript code attached to frame 1 of the single layer with the following actionscript code:

    Import 12345678910111213import;
    import flash.display.Sprite;

    var bmpSprite:Sprite = new Sprite();
    addChild (bmpSprite);
    trace ("*" + bmpSprite + "*");

    function addBMP(b:Bitmap):void
    {
    trace ("=" + bmpSprite + "=");
    BMP = b;
    bmpSprite.addChild (b);
    }

    I have the following text in a class AS file:

    If (name is "GoalCard")
    {
    var p10:Puzzle10Piece10 = new Puzzle10Piece10();
    trace (new Bitmap (p.getImages (). Hallway [1]));
    variableArea.addChild (p10);
    P10.addBMP (Bitmap (p.getImages (again). Hallway [1]));
    }

    Produces the following output:

    CLASS: PictureTools FUNCTION getImages() return [[object Object]]
    [object Bitmap]
    CLASS: PictureTools FUNCTION getImages() return [[object Object]]
    ========== null ===========
    Bland (out) lightbox FEATURE
    [object Sprite] *.

    The "trace (new Bitmap (...". "is only to show that I am sending a valid bitmap object to the function, I'll call you.

    This goes against my understanding of the pre-compiler and code execution order.  In my way of thinking, any creation of reference and memory related distribution is performed when the object is instantiated, and indeed that allocation, unlike C does not depend on code order (statement before use), although it is a command that can reach even the C pre-compiler.  If I understand correctly the compiler in Flash at all, it's not even a question of "order of the code"... the symbol is pre-compiled such that it exists... so that it can be instantiated, the variable would exist before the function would be "available" to be called internally or externally.

    Is my way of thinking to the coast, or is this a bug?

    at least since flash mx.

  • Error in the compiler/bug "PDACluster"... »

    Hello world

    I met a strange compilation error when I tried to build the following program for the target LM3S1968 (ARM MCU).

    If I try to compile it:

    I get this error:

    Building target "LabVIEW".
    compilation of RTX_Config.c...
    ...
    compilation of RLARM_CCGTcpUdpSupport.c...
    compilation of RLARM_CCGNetConnSupport.c...
    compilation of RLARM_LVNetworkVarSupport.c...
    compilation of RLARM_CAN_Wrapper.c...
    which connects...
    .\Obj\LabVIEW.axf: error: L6218E: Undefined symbol PDAClusterFree (called lvring.o).
    .\Obj\LabVIEW.axf: error: L6218E: Undefined symbol PDAClusterGetElemByPos (called lvring.o).
    .\Obj\LabVIEW.axf: error: L6218E: Undefined symbol PDAClusterSetElemByPos (called lvring.o).
    Target not created

    Anyone have any idea what causes this? I do not use any special VI, only the standard tools. Thanks in advance.

    Paul

    Hi Paul,.

    This is a known issues with the controls of the ring and should be corrected in the next version.  The appropriate functions are undefined when they should.

    To work around the problem, just drop an error checking in your VI and the problem should go away.

  • False alarm the CS6 upgrade purchased installation...

    Bought Photoshop CS6 upgrade for my CS5 64-bit edition of Windows 7 computer.

    Through licenses, obtained the serial number of my account at Adobe, downloaded the software and then, in the setting up, got:

    «Installation Failed «...»» "the product that you are trying to install is not authentic Adobe software and seems to be false. »

    Danderby often occurs if the Setup files are corrupted.  Please try to download a new copy installation CS6 to http://forums.adobe.com/message/5418120#5418120 files.

  • Vista on Satellite L30: false of the background toolbar

    After a little while false of the background toolbar and I can't do a lot with the machine that can not select a program to be on.

    Is there a solution for this with vista?
    Laptop is old for a day and did a few times now?
    Seems that vista bug?

    Not bright at all with vista yet, lost all user-friendly options but its what has been provided so will try and fight for a little time with her.

    Hello

    I can't imagine that there is a bug in Vista. I assume you should check all the Settings toolbar. If there is nothing to do again resumed sent media and install Vista.

  • function index() in LabWindows 2013 of the compiler

    LabWindows CVI 2013 compiler complains about the use of the variable global 'index', even if 2010 LabWindows is OK with that. The error is an error that is redefined as LabWindows 2013 confused with an old C library string index function.

    Is there a simple solution for that, instead of rename my variable global 'index' in another name?

    Hello nhd973!

    The behavior that you are experiencing is unfortunately a known issue in CVI 2013 (see section incompatibilities):

    http://www.NI.com/product-documentation/51877/en/

    Around that, the simplest method is to rename your global variable.

    However, there is a back door that you can use, which forces the compiler to LabWindows/CVI to ignore the internal controls. You can change the following configuration for these built-ins registry key:

    HKEY_CURRENT_USER\Software\National Instruments\CVI\13.0\Environment\DisableBuiltIns

    By default, this key value is False . Setting its value on True allows the compiler to LabWindows/CVI ignore builtins, so you should not encounter the error again.

    Best regards!

    -Johannes

  • Some General Questions of CVI - how does the compiler

    Hello

    I work with CVI 9.1 for more then a year during this time i ' v noticed a couple things, I would like to help me to understand.

    1. Work with several C files:
    • When I'm writing a software that uses lets say C files and files of 10 H 10: Main.c Main.h File1.c File1.h Panels.h Panels.uir and so on... I'm implementation of the function in the c file and its deceleration of writing in the file h, i ' v noticed that sometimes I get msgs of the compiler on the conflicts, maybe there's a way I know not just for the CVI?
    • Works correctly with the file UIR for example lets take the files written above, if I have sign - HAND and control led1 and I want to do SetCtrlVal in the Main.c I can implement as this SetCtelVal(MAIN,MAIN_LED1,1); but when I go to file1.c and try to do it, I get the error message that main_led1 is not a control value (I included the Panels.h) this problem happens to me a lot is there a solution? or maybe I am doing something wrong...
    • What is the best way to implement bollean var (true false) for the software? is it possible to add this var always?
    • decelerations of incompatible type: allows you to take the Fmt function for example when I'm trying to use it in another file, I get the decelerations of incompatible type with the names of the files...
    • General question: lets say I want to include in my project and I want to use its features in main.c and file1.c, I included in two files? or there is a way to include it in a single file only?

    2. to access the buttons

    • lets say that I have buttons and I am pressing on it after pressing the button I have a loop for 10 min, I want to create a button give up, but I can't press anything because the keys are "locked out" is there a way besides multi threading to implement this?

    Wow! A very broad set of issues!

    A quick response.

    • Works correctly with the file UIR for example lets take the files written above, if I have sign - HAND and control led1 and I want to do SetCtrlVal in the Main.c I can implement as this SetCtelVal(MAIN,MAIN_LED1,1); but when I go to file1.c and try to do it, I get the error message that main_led1 is not a control value (I included the Panels.h) this problem happens to me a lot is there a solution? or maybe I am doing something wrong...

    There is a basic error in your statement: the first (SetCtrlVal) parameter must be the handle Panel, which is the reference to the object in memory that is created when you call LoadPanel (). Using the name of constant sign is not correct: it may work if you're lucky and you have the Panel handle with the same value as the name of the constant, but this certainly isn't the correct way to address on a panel controls.

    Even if I don't understand the error that you declare: I expect 'the control is not of the type expected by the function' or an error of inconsistent data type (like passing an int to double check) or...

    Remember that each function that processes objects on a Panel must be aware of the handful of Panel, then either you pass to the function as a parameter, or store it in a global variable.

    • decelerations of incompatible type: allows you to take the Fmt function for example when I'm trying to use it in another file, I get the decelerations of incompatible type with the names of the files...

    I normally leave CVI #including the necessary system files: when I use certain functions like Fmt in a source file and compile ICB warns me to add the relevant include file, and it does it correctly. Operating in this way I never had problems with formatting and the I/o library functions. You can rebuild the inclusion list by removing all #includes in yous source files and compilation of the project, this should correct errors

    • General question: lets say I want to include in my project and I want to use its features in main.c and file1.c, I included in two files? or there is a way to include it in a single file only?

    You must include the file containing the definitions of the functions in all source files that use. Or you can create a general include file with all included in your project and include only this one in all of your source files

    • lets say that I have buttons and I am pressing on it after pressing the button I have a loop for 10 min, I want to create a button give up, but I can't press anything because the keys are "locked out" is there a way besides multi threading to implement this?

    It is a general rule that animates the CVI environment: during the execution of a loop inside a function (a reminder of command or another function) the system does not handle the user interface events, so that your buttons appear locked. This can be solved by adding a call repeated (ProcessSystemEvents) inside the loop: this way of all UI events are monitored and managed by the system.

    You must use this method with caution: before entering the loop, you must disable all the controls that can be used during operation (normally only the Quit button should stay active) otherwise, you can enter a situation in which other callbacks are executed during the loop that might interfere with it.

    In such a case, do not put a reminder in the stop button and the use of a global variable I have normally create a toggle button Stop and manipulate it in this way:

    While (1) {}

    ....

    ProcessStemsEvents ();

    GetCtrlVal (panelHandle, PANEL_STOP, &stop);)

    If {(stop)

    ... gracefully out of the function

    break;

    }

    }

    This argument has been discussed several times in the forums: do a search for ProcessSystemEvents returns a large number of discussions you can read

    • What is the best way to implement bollean var (true false) for the software? is it possible to add this var always?

    CVI is not a native boolean value. I used to use an int and test weather it is zero or not

    • When I'm writing a software that uses lets say C files and files of 10 H 10: Main.c Main.h File1.c File1.h Panels.h Panels.uir and so on... I'm implementation of the function in the c file and its deceleration of writing in the file h, i ' v noticed that sometimes I get msgs of the compiler on the conflicts, maybe there's a way I know not just for the CVI?

    I do not understand what you describe: could you add some piece of code allowing to penetrate this situation and report exactly the message the compiler warns?

  • False alarms

    Running the trial of vFoglight and very impressed so far.
    However, we are still getting false alarms such as:

    • Machine virtual xxx has recently been turned off. This rule detects a VM is turned off or paused.
    • Logical drive C:\ on machine virtual xxx was 5.81% available and full of 94.19%. This rule is triggered when the use of the disk reaches less than 5% of the full.

    Even if we recognize and disable the alarm, it reappears. In the latter case we offer more space, so the alarm is not applicable.

    Any ideas how to fix?

    Hello infra1234,
    Question #1 it is a groovy script that will fix it if there is no virtual machines for which you get alarms
    Rule question #2 pulled the alarm can be twisted, but would need to take a look at your environment
    My suggestion would be to open a support case.

  • Compilation of FDI: mismatched CPU target between the compiler and the linker

    Hello

    When I compile my project, it gives an error of link:

    G:\bbndk\host_10_0_9_534\win32\x86\usr\bin\ntoarm-ld: src\main.o: relocation in generic ELF (EM: 3)
    src\main.o: could not read symbols: file in wrong format

    Looking at orders of compilation that I see the files objects created with - V4.6.3, gcc_ntox86_cpp and the linker, try using - V4.6.3, gcc_ntoarmv7le_cpp

    If I click with the right button on the project and select Properties, is specifies the target as the ARM v7 and options to the compiler/assembler/linker including - V4.6.3, gcc_ntoarmv7le_cpp, that is correct.  But if I right click on the 'src' dir and select properties is said - V4.6.3, gcc_ntox86_cpp, which gives the conflict.  Where he does this from?

    I tried "Restore default" and change options around, but it didn't fix the problem.   Is this a bug?   How can I fix the "-V4.6.3, gcc_ntox86_cpp" question?   Is there something that I don't see?  Do I have to manually edit the .project files to fix the problem?

    The version of the IDE is

    Version: 10.1.0
    Build id: v201302012246

    Thank you!

    Solved my problem.   Is go to the cpp files individual and selected "resource Configurations"-> reset by default.   Not sure why she chose x 86 front and the change of target does not spread.

  • Developer SQL not display warnings from the compiler

    I just test the new compiler in 11g warning message related to the exception handler so that "others" when there is a subsequent increase or raise_application_error.

    in SQL Plus, it works fine:

    SQL> alter session set plsql_warnings='enable:all';
    
    Session altered.
    
    SQL>
    SQL> create or replace function do_stuff
      2  return number
      3  as
      4     v_return number;
      5  begin
      6
      7     v_return := 3;
      8     return v_return;
      9
     10  exception
     11  when others then
     12     return null;
     13  end;
     14  /
    
    SP2-0806: Function created with compilation warnings
    
    SQL> show errors;
    Errors for FUNCTION DO_STUFF:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    1/1      PLW-05018: unit DO_STUFF omitted optional AUTHID clause; default
             value DEFINER used
    
    11/6     PLW-06009: procedure "DO_STUFF" OTHERS handler does not end in
             RAISE or RAISE_APPLICATION_ERROR
    but Developer SQL, the output is:
    BANNER                                                                           
    -------------------------------------------------------------------------------- 
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production     
    PL/SQL Release 11.2.0.3.0 - Production                                           
    CORE     11.2.0.3.0     Production                                                         
    TNS for Linux: Version 11.2.0.3.0 - Production                                   
    NLSRTL Version 11.2.0.3.0 - Production                                           
    
    session SET altered.
    FUNCTION do_stuff compiled
    No Errors.
    Someone at - there experience this problem? is there a setting that makes Developer SQL behave differently?

    There is a bug.

    The solution is to make sure that the name of the object in CREATE or REPLACE is uppercase

    So in your example make DO_STUFF

    Run as a Script

    Then check the compiler Log/Logging Panel, you will see your mistakes.

    It has been marked to be fixed in our next release.

  • Problem with the compilation of AIR with the (police) Embed tag

    Hello

    I have an application developed for AIR. When I compile it without the fonts I need to incorporate it is compiled without a problem when I add the Embed tags then it compiles, but when it runs, it cannot be used, the input text fields are not accessible.

    Has anyone encountered this problem? What could be the possible reasons?

    Here's an example of how I embed fonts.

    [Embed (systemFont = "FreeSans", embedAsCFF = 'false', fontName = "FreeSansEmbed", mimeType = "application/x-font")]

    private var freeSansFont: Class;

    Thank you

    Ana

    I tried a long time ago and had some success (but I did day to 2.7 and 3.0, not directly to 3.0, don't know if this is important):

    http://blog.prevail.co.nz/2011/06/21/overlaying-air2-7-in-Flash-CS5/

    You can change the allocation of Java heap size and increasing the memory available to it often allows compiles to happen. Flash CS5.0 you can find this setting in this file:

    C:\Users\[your USER] \AppData\Local\Adobe\Flash CS5\en_US\Configuration\ActionScript 3.0\jvm.ini

    I have bolded en_US because obviously we English, change your language if necessary.

    Adjust the value-Xmx128m to-Xmx256m (128 MB-> 256 MB) and try that. You can also try to go to 512 m, but I had a few teething problems of the java virtual machine using a lot of ram (don't know why). This will increase the amount of RAM, the compilation process is allowed to use.

  • VISA does not not for the compiled application

    I wrote an application that uses VISA, mainly GPIB resources.  in any case, my laptop has labview 8.5 installed on it.  When I run the app on my phone, it uses the GPIB fine, compiled or not compiled.  When I take the compiled application on my desktop which has run labVIEW files installed on it, the VISA resources are not even detected (nothing appears in the drop-down list control) in the application, but I can see them in MAX that is installed on the desktop computer.  Any suggestions?

    Brent

    It seems that you have not included the VISA run-time when you generated the installation program. You have only included NOR-488 and MAX because the instruments are detected and MAX use visa when he performs an analysis of the instruments. You've created an installer didn't you?

  • Why do I get the compile time extremely long with FIFO on the cRIO-9073?

    I use a cRIO-9073 to develop a data acquisition system.

    When I try to use a FIFO to pass data to the host the FPGA, I get extremely long to compile (hours!).

    Currently, I use that a single analog input of a module 9205 in my loop FPGA.

    Y at - it an explanation for that?

    Thanks for any help you can provide.

    Michel

    Paul,

    Thanks for your reply.

    I finally found the problem: the size of FIFO, I requested in the properties of the FIFO was too large to 32K items (for the type of data the FIFO U32) 4 times. He was filling the FPGA, 128 KB of RAM completely, leaving no room for manoeuvre for the compiler for the remaining logic. So bad, there was no warning for that!

    By reducing the size of my FIFO at 4K, the compile time came in 5-10 minutes instead of hours!

    Michel Lanthier

  • Error 2013 CVI: the compiler has run out of memory.

    Hello

    I get this error in a source file, I want to debug:

      1, 1   Error: The compiler has run out of memory.
          1, 1   Note: You may be able to work around the problem:
          1, 1   A. Set the debugging level to 'no run-time checking'.
          1, 1   B. Split your source file into smaller files.
          1, 1   C. Enable the 'O' option for your source file in the project.
          1, 1   D. Move large static data structures into new files and
          1, 1   enable the 'O' option for the new files.
    

    Options A and C turn off debugging AIDS especially, and I don't dare edit.

    So no possibility to increase the memory limit?


  • How is it when I try to open one of my favorte often visited Web sites I get a blank page with only the word 'false' in the upper left?

    How is it when I try to open one of my favorte often visited Web sites I get a blank page with only the word 'false' in the upper left?

    This just started happening the last two days.  I tried to add the url to my list to activate in Internet Options, also to accept the list for windows firewall. I rebooted and restored.

    It is annoying when I can't access Web sites on my PC.  There is no control parenting, nor is it a reason to be since I'm 57 years old, single, live alone and have no children, and not to mention that this isn't a single adult site. This is an auction site.  The same thing happens on a site of sports too.

    Hello

    Thank you for writing to Microsoft Communities.

    I understand how it could be frustrating when things do not work as expected. Please, I beg you, don't worry I'll try my best to resolve the issue.

    1. what operating system is installed on the computer?

    2. what version of Internet Explore do you use?

    3 have there been recent changes to the computer before the show?

    Please go ahead and follow the steps mentioned and later a update on the State of the question.

    Method 1: Start Internet explorer with the mode without modules and check.

    Click Start, all programs, accessories, System Tools, and click Internet Explorer (No Add-ons).

    If the problem does not persist in Internet Explorer (No Add-ons), then it is one of the Add-ons at the origin of this problem. Please follow the steps below to locate the problem the weak module:

    a. restart IE normally.

    b. click on tools.

    c. click on Manage Add-ons.

    d. disable add-ons by clicking on them one at a time to highlight and then click Disable.

    e. reactivate modules one by one and check with what add-on, you get this error message.

    f. turn off the add-on at the origin of the problem.

    For your reference: http://Windows.Microsoft.com/en-us/Windows7/Internet-Explorer-Add-ons-frequently-asked-questions

    (For Windows Vista)

    Method 2: How to optimize Internet Explorer:

    http://support.Microsoft.com/kb/936213/no

    Important: Reset Internet Explorer to its default configuration. This step will disable also any add-ons, plug-ins or toolbars that are installed. Although this solution is fast, it also means that, if you want to use one of these modules in the future, they must be reinstalled.

    Follow these recommended steps and after if you still experience the problem.

Maybe you are looking for

  • Where is my Windows XP key?

    Telephone support at HP and M$ was useless on this issue.  Also, filed a case with CV and got some of the canned response and then dismissed my case.  Then I'll try the forums. I am trying to create an image for cloning Windows XP in my small office.

  • An attachment sent to ePrinter HP printing

    The attachment PDF 10 KB to an e-mail, sent to the ePrint address of a printer HP Photosmart 6510 all-in-one Mac OS X Lion, will not print the attachment. If the same email is sent from HP computer to the address of the HP Photosmart 6500 ePrint, pri

  • Camera HS SX50

    Salvation; Having a camera SX50 HS and follow the directions in the manual I cannot access the AWB, the white balance, as the list of icons including the icon of the AWB appear not as described in the manual.  What Miss me?  Charlie

  • Pavilion23: Windows 10 opening curiosity file

    I just upgraded to Windows 10 of 8.1 and presenting a curious flaw.  When opening files, they come to the top in read-only mode. Of course I can fix this by resetting the permissions, which requires approval from my Admin I have for this to the next

  • BB10 advertising Service

    the ad service is available for BB10? I have a post in the forum of service ad, but no response.