LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

using clang optimizing compiler yields run-time errors not encountered when using CVI standard compiler

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!

0 Kudos
Message 1 of 5
(3,095 Views)

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

0 Kudos
Message 2 of 5
(3,077 Views)

Hey Wolfgang,

 

I subscribe to NickB's view. Without being able to reproduce the issue, we cannot help you.

 

Best regards

Suse

______________________________
Certified LabVIEW Developer (CLD)
0 Kudos
Message 3 of 5
(3,049 Views)

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

Labwindows/CVI user since version 4.0
0 Kudos
Message 4 of 5
(2,826 Views)

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

0 Kudos
Message 5 of 5
(2,755 Views)