Parameter evaluation order - CVI 2012 vs. 2013

Here's something I just recently got burned with.  It turns out that CVI 2013 evaluates parameters in a function call in a different order than CVI 2012.  Take this code for example:
#include <stdio.h>
void multiprint(int arg1, int arg2, int arg3, int arg4, int arg5)
printf("%d, %d, %d, %d, %d\n", arg1, arg2, arg3, arg4, arg5);
return ;
int main(int argc, char *argv[])
int i = 5;
multiprint(i--, i--, i--, i--, i--);
return 0;
In CVI 2012, this will print:
1, 2, 3, 4, 5
In CVI 2013, this will print:
5, 4, 3, 2, 1
I actually did some digging on this, and it turns out that the order that parameters in a function call are evaluated in C is undefined, which means that while CVI 2013 compiles this code differently than CVI 2012, neither one of them are doing anything incorrect (per the specfication).
Anyhow, just something to watch out for if you're migrating projects to CVI 2013!  

Hi,
Thank you for pointing this out.  As you mentioned, the compiler has changed between the 2012 and 2013 versions of CVI.  CVI 2012 uses a custom CVI compiler, whereas CVI 2013 switched over to the clang compiler.
Regards,
Lindsey W. | Applications Engineer | National Instruments

Similar Messages

  • Qsort issue with CVI 2012 in 64 bit mode

    Possible CVI 2012 64 bit bug.
    Qsort returns very slowly in CVI2012 in 64 bit release mode. Not sure if there are memory leaks or if function actually returns the correct answer as I fixed the problem before going back and isolating the issue to the code supplied. The issue seems to be resolved in CVI 2013.
    In the example provided, an array is created, seeded, and sorted. Approximate timing results (with a chi by eye averaging) are given below for an array of 1e6 double values.
    CVI 2012
    32 bit debug                         32 bit release                                       64 bit debug                                    64 bit release
    4.5 seconds                         0.32 seconds                                       4.3 seconds                                     44.0 seconds
    CVI 2013
    32 bit debug                         32 bit release                                       64 bit debug                                    64 bit release
    2.8 seconds                          0.22 seconds                                      2.0 seconds                                     0.18 seconds
    Attachments:
    qsort test.zip ‏3 KB

    Hey,
    Thank you for your feedback, I compiled your code and you are right. In CVI 2013 the problem seems to be solved. Unfortunately, I can't place a CAR (correction action request) for CVI 2012 because the problem has been addressed by our R&D department. 
    Thanks again for your feedback.

  • MSTcpIP.h errors in CVI 2012

    Hi 
    I have been using LabWindos CVI 8.1 and I am now looking into upgrading to 2012, so i have downloaded the trial version from the NI website and installed it. 
    When i open and go to compile my project which uses the Winsock2 library in CVI 2012 i get some stange errors inside mstcpip.h.
    "MSTcpIP.h"(331,1) syntax error; found 'identifier' expecting ';'. 
    #if (NTDDI_VERSION >= NTDDI_WIN2KSP1)
    MSTCPIP_INLINE
    BOOLEAN
    IN4_ADDR_EQUAL(__in CONST IN_ADDR *a, __in CONST IN_ADDR *b)
        return (BOOLEAN)(a->s_addr == b->s_addr);
    it is happening on the 3rd line which reads just BOOLEAN 
    which has been defined by this code in WinNT.h
    typedef BYTE BOOLEAN;
    typedef BOOLEAN *PBOOLEAN;
    where BYTE is defined in WinDef.h
    typedef unsigned char       BYTE;   
    I do have a typedef unsigned char Boolean; in my code but i don't think that should be a problem as C is case sensative. 
    Any help would be greatly apreciated
    Thanx
    -Jon

    Hi Daniel,
    Thanx for the reply 
    I had my includes in the following order
    #include <stdlib.h>
    #include <stdio.h>
    #include <winsock2.h>
    #include <windows.h>
    #include <MSTcpIP.h> 
    #include <Iphlpapi.h>
    //#include "C:\Program Files (x86)\National Instruments\CVI81\sdk\include\MSTcpIP.h"
    If i directly link to the old CVI8.1 file it compiles fine without errors.  
    I just rearanged the includes into this order 
    #include <windows.h>
    #include <MSTcpIP.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <winsock2.h>
    #include <Iphlpapi.h>
    And now it compiles fine, not really sure why but as long as it works  
    Thank you very much for your help,
    -Jon

  • Is it possible to upgrade Server 2012 Evaluation to Server 2012 R2 Evaluation?

    I ask this because I accidentally installed Server 2012 (non R2) Evaluation and I already bought the key for Server 2012 R2 Standard. Is there anyway I can somehow perform the upgrade from Server 2012 Evaluation to Server 2012 R2 Evaluation and then add
    the license key? Or worst case, maybe I can downgrade or swap my Server 2012 R2 license key for a Server 2012 one? I'd rather upgrade to Server 2012 R2 but my priority is to avoid a reinstall.

    The downgrade might be possible. Read on here.
    http://blogs.technet.com/b/licensing/archive/2013/02/07/downgrade-rights-explained.aspx
     http://www.microsoft.com/oem/en/licensing/sblicensing/pages/downgrade_rights.aspx#fbid=q1rtYmE7qhf?hashlink=server
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • What is the difference between 2012 and 2013 27'' base model iMac's?

    Hi guys,i live in Turkey and i am looking for buying an 27'' iMac actually i don't want to buy from apple store online because other store's are just selling them like 300Turkish Liras = 150 dollars cheaper.But i have got a problem in Turkey Tech stores are not writing the release date of the iMac.So i am kinda confused.They are writing the features about it so by reading the features i can understand if they are selling 2012 or 2013 but i couldn't find the feature differences between them clearly hope some of if you know and let me know about it too.So i am looking forward to hear from you.Goodbye !
    Espri Nefes Elmaagacli
    <Personal Information Edited by Host>

    •MacTracker main:
    http://mactracker.ca
    •Everymac.com main:
    http://everymac.com
    •Apple iMac Specs (only 27-inch) from everymac.com: 2012 + 2013:
      iMac "Core i5" 2.9 27-Inch (Late 2012) 2.9 GHz Core i5 (I5-3470S)   
      iMac "Core i5" 3.2 27-Inch (Late 2012) 3.2 GHz Core i5 (I5-3470)   
      iMac "Core i7" 3.4 27-Inch (Late 2012) 3.4 GHz Core i7 (I7-3770)   
      iMac "Core i5" 3.2 27-Inch (Late 2013) 3.2 GHz Core i5 (I5-4570)   
      iMac "Core i5" 3.4 27-Inch (Late 2013) 3.4 GHz Core i5 (I5-4670)   
      iMac "Core i7" 3.5 27-Inch (Late 2013) 3.5 GHz Core i7 (I7-4771)
    {this does not include the method of model identifier build year sequence}
    •Apple iMac Specs (All iMac Tech Specs)
    http://www.everymac.com/systems/apple/imac/index-imac.html
    Hopefully this helps...
    Good luck & happy computing!
    edited

  • While trying to open the order in co03 or co02, It is not opening and showing the error message as "Inconsistent data : order 107434 16.09.2013, duplicate entry o 0020. is showing ?

    Hi,
    While trying to open the order in co03, co02, I am getting the below error message : Inconsistent data : order 107434 16.09.2013, duplicate entry o 0020 is showing. Please guide me the way forward.
    Regards,
    Mastan.

    Hi Mastan
    The report mentioned by Rajen should clear the inconsistent records.
    Please observe that you could have found this by yourself report with a quick note search for this error message or even searching for old threads.
    Even a google search points to the solution.
    You should do your own research before opening such kind of thread.
    BR
    Caetano

  • Evaluated order of Pivot and UnPivot in select statement

    My research which evaluated order of select statement is below.
    1 from
    2 where (Join condition)
    3 start with
    4 connect by
    5 where (filter of rows)
    6 group by
    7 having
    8 model
    9 select
    10 order byMy question is Where Pivot clause and UnPivot clause ?
    http://download.oracle.com/docs/cd/E16338_01/server.112/e10592/statements_10002.htm

    Provided that you can specify columns created by the PIVOT clause both in the select and in the Order By clause, I think the pivot must be executed before them:
    SQL> r
      1  select job, d10,d20,d30 from emp
      2  pivot (sum(sal) for deptno in (10 as D10, 20 as d20, 30 as d30))
      3* order by d20
    JOB              D10        D20        D30
    CLERK                       800
    CLERK                      1100
    MANAGER                    2975
    ANALYST                    3000
    ANALYST                    3000
    SALESMAN                              1600
    PRESIDENT       5000
    MANAGER         2450
    SALESMAN                              1500
    SALESMAN                              1250
    CLERK           1300
    MANAGER                               2850
    SALESMAN                              1250
    CLERK                                  950
    Selezionate 14 righe.
    Piano di esecuzione
    Plan hash value: 1739977809
    | Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |      |    14 |   518 |     5  (40)| 00:00:01 |
    |   1 |  SORT ORDER BY       |      |    14 |   518 |     5  (40)| 00:00:01 |
    |   2 |   HASH GROUP BY PIVOT|      |    14 |   518 |     5  (40)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL | EMP  |    14 |   518 |     3   (0)| 00:00:01 |
    -----------------------------------------------------------------------------Max

  • Need help about refurbished MacBook Pro 15" 2012 vs 2013

    Hello All,
    I'm planning to buy a refurbished MacBook Pro since I'm tight with budget. This would be my first mac machine ever. So I was hoping if someone can shed some opinion on which one should I go for. But first, I will be using the MacBook for basic photoshop, Office documents (Word, Excel, Outlook, Powerpoint), internet, and maybe (just maybe) if I have time from my busy work, I could try to learn in movie editing (just for fun). So anyway, I found 2 refurbished 15" MacBook Pro that fits my budget and seems like they're quite similar (2012 and 2013). The 2013 is only $20 more.
    1) Refurbished 15.4-inch MacBook Pro 2.3GHz Quad-core Intel i7 with Retina Display - $1,469.00
    Originally released June 2012
    15.4-inch (diagonal) Retina display; 2880-by-1800 resolution at 220 pixels per inch
    8GB of 1600MHz DDR3L SDRAM
    256GB Flash Storage
    720p FaceTime HD Camera
    NVIDIA GeForce GT 650M with 1GB of GDDR5 memory
    2) Refurbished 15.4-inch MacBook Pro 2.0GHz Quad-core Intel i7 with Retina Display - $1,489.00
    Originally released October 2013
    15.4-inch (diagonal) Retina display; 2880-by-1800 resolution at 220 pixels per inch
    8GB of 1600MHz DDR3L SDRAM
    256GB Flash Storage1
    720p FaceTime HD camera
    Intel Iris Pro Graphics
    So it looks like the difference between the two is obviously the CPU, the 2012 having an extra GPU, and the 2013 uses the Thunderbolt 2 as far as I know. And I'm not sure if the SSD on the 2012 is SATA as oppose to the 2013 it's PCIe? Base from what I explained above on how will I'll be using the MacBook for, is the 2012 best fit for my needs or is the 2013 a better one?
    Thanks all. Please remember I don't have any experience with Macs at all. So I'm hoping someone can help me a little bit. Thanks again.
    - Eddie

    PS: side-by-side specs, graphics and drive data rates,
    the newer of the two may be the better one to get, as
    it has later Thunderbolt  with higher capacities, too.
    Look into mactracker or other specification chart that
    can be opened beside each other (as I have now) &
    then you can see sections in each model, one at a
    time. MacTracker shows general-software-memory+
    graphics-connections-history by category.
    2013 model Thunderbolt, Hard Drive Interface, graphics
    spec all look good. Not sure if the history of graphic issue
    in the dual-graphic card model 2012, was overcome or not.
    However this may require some research...
    If yours is one that shipped with Mavericks OS X 10.9
    you may do well to get a copy of the installer on a
    USB and dedicate it as a backup or set up a second
    drive or other device to safe a download of the installer
    and/or a copy-clone of the Mavericks. The limited total
    of RAM available may not be a problem, with both units
    shipping with an SSD and not a rotational HDD. And if
    you like (& if yours has OS X 10.9) you could then use
    OS X 10.10 too.  Be careful an 'upgrade' isn't done to
    an older system by accident; surprises aren't so nice.
    With either choice, be sure to get & make suitable backup
    of your files in addition to a device to use Time Machine.
    Good luck & happy computing!

  • Hi, if IPhone 5 was manufactured in 2013 (after release of IOS 6.1.4) what would release date of be iphone written in IMEI info? 2012 or 2013?

    Hi, if IPhone 5 was manufactured in 2013 (after release of IOS 6.1.4) what would release date of be iphone written in IMEI info? 2012 or 2013? Please answer. Thanks.

    Hi ttechnoffreak,
    First I would suggest signing out and back in to the iTunes Store by using the same account and following this article:
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/ht1311
    Restarting and/or resetting may also help:
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    Cheers!
    - Ari

  • How to use CVI 2009 with CVI 2012 installed

    I have TestStand 2012 / CVI 2012 installed. 
    I need to also test using teststand 4.2.1 / CVI 2009.
    I installed teststand 4.2.1 / CVI 2009 and can activate teststand 4.2.1 but I cannot access CVI 2009. 
    Is there any way to have CVI2009/2012 both available on the same computer? 
    Is there a way to compile CVI 2012 to work with TestStand 4.2.1?

    Hi HMRJ,
    You can have multiple versions of CVI installed on the same computer. Can you explain in detail what you mean when you say that you cannot access CVI 2009? Do you mean that you can't open it or can't activate it?
    I am not sure I understand what you mean by compiling CVI 2012 to work with TestStand 4.2.1. You should be able to create a DLL from CVI 2012 and call this code module from TestStand. Are you receiving any errors when you try to do this?
    Regards,
    Anjelica W.
    National Instruments
    Applications Engineer

  • Explain me briefly about evaluation order.As per my knowledge it show data type order.but I have different data type in same diemension ex:account- acc_001 is smart list data type.account-ac_002 is percentage.So fot this i will accont dim in evaluation or

    Explain me briefly about evaluation order.As per my knowledge it show data type order.but I have different data type in same dimension ex:account->acc_001 is smart list data type.account-ac_002 is percentage.So fot this i will accont dim in evaluation order.What going can any one explaining brifly ?

    2786712 wrote:
    thanks John for reply.If you dont mine can you explain clearly with example and screenshot.
    @John: You got a task
    Here you go: Hyperion Planning and More...

  • I created a calendar in the wrong calendar year.   I need to change it from 2012 to 2013. Help!!!

    I created a calendar in the wrong calendar year.   I need to change it from 2012 to 2013. Help!!!

    N000295, I am afraid you will have to start all over again. There is no way to change the year of the already created photo calender.

  • What is the evaluation order of Page Items

    I just wonder what the execution order of page item assignments are in the page rendering process.
    Sequence (+ Region), Type of items, more clever by checking dependencies ??
    I couldn't find anything here, or looked with the wrong keywords.
    I just need to know, what reliable assumption to make about dependencies amongst page items?
    Is that visible in the APEX code? A pointer to that would be OK.
    Many thanks
    Thomas

    fac586 wrote:
    What do you mean by "assignments"?The "Source" ("Source value or expression" in combination with the "Source Type") on the Page Item [Application Express 4.1.0.00.32]
    fac586 wrote:
    Items are rendered in order of region position/region sequence/item sequence. Item values will be evaluated in this order, but may also be set by computations or processes which run in order of processing point/computation sequence/process sequence.
    You can view page components in event order in the App Builder by selecting the Utilities > Page Events view in the page definition, and the actual sequence of runtime events in the debug trace.That was exactly what I was thinking, but that is not the case as far as I can tell. The order which is shown "*Utilities > Page Events*" seems to be the display order, but not necessarily the evaluation order in order to obtain the values.
    I have a database field that is shown much further down in this sequence, but I have a dependent field that is calculated based on this value and is shown before in that sequence.
    So I was wondering whether there is an implied order - possibly based on the Source Type of the page item.
    And to answer the question. There are no other computations or processes ... other than the associated "Automated Row Fetch" related to the database column used in the page items on the page.

  • Anyone having trouble with their calendar? I just lost 3/4 of the info I had for 2012 and 2013?

    I was just adding a date into my calendar and I all of a sudden lost 75% of the info I had in there for 2012 and 2013? Any one have any ideas?

    System data is the OS or operating system.  That is where the recovery stays separated from the rest of the storage so that it doesn't get corrupted.  It is not accessible and non-movable.

  • Dimension tabs Performance vs Evaluation order

    Hi All,
    We use planning 9.3.0.1.
    What is the difference between Performance settings vs Evaluation order? What I know is that if we have to set hour glass/ hour glass on stick we need to change the order of the dimensions in Performance settings tab.
    Any information will be very helpful.
    Thanks,
    AD

    Same question as :- Dimension tabs Performance vs Evaluation order
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for