01-17-2011 07:30 AM
Hi,
I have compiled an executable using Clang with the template provided by NI.
Interestingly I receive errors (generated by checking the UI return code) that I do not get when running the executable created using CVI's standard compiler.
There are no compilation warnings / errors by neither compiler.
Any hints what one could do to track down the problem?
Thanks!
01-17-2011 05:02 PM
Hey Wolfgang -
I've not seen anything like this while using the Clang compiler. Is there anyway you can post some code that reproduces what you're seeing?
NickB
National Instruments
01-20-2011 04:02 AM
Hey Wolfgang,
I subscribe to NickB's view. Without being able to reproduce the issue, we cannot help you.
Best regards
Suse
10-18-2013 08:02 AM
Hi Wolfgang,
I know that your issue is quite old but may be this post will help.
I have also observed differences between Clang and CVI2012 compiler.
In the following expression :
a[i] = b[i++];
CVI compiler will evaluate '++' after '=' operator while Clang does it before.
The consequence is that CVI compiler performs a[N] = b[N] while Clang performs a[N+1]=b[N].
The project in attachment shows this behaviour, the message box will display different strings when compiled with CVI or Clang compiler.
Regards,
Stephane
11-04-2013 05:05 AM
Hello!
The behavior of your code snippet is undefined. These links explain the issue better than I can.
http://c-faq.com/expr/evalorder1.html
http://c-faq.com/expr/evalorder4.html
http://c-faq.com/expr/seqpoints.html
http://en.wikipedia.org/wiki/Sequence_point
Sequence points in the C99 standard: section 5.1.2.3 and appending C. See also the index.
Regards,
Peter