From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-18-2016 07:48 AM
Hello, hello,
I'd like to rewrite some of my old side-effect macros in a more modern (C99/C11) way using compound statements, such as this:
#define MIN(x,y) ({ __auto_type __x = (x); __auto_type __y = (y); __x < __y ? __x : __y; })
It compiles fine with gcc, but Clang used by CVI gives me the error mentioned in the title. Apparently, all I need to do is to add -Wno-gnu, but I don't see where I can add compiler-specific options.
I also tried #pragma clang diagnostic ignored "-Wno-gnu" without success
Solved! Go to Solution.
10-18-2016 09:49 AM
Hi gdargaud,
The CVI compiler doesn't support GNU statement expressions. This is currently documented in this KB document.
Here's an alternative for your use case: https://gcc.gnu.org/onlinedocs/cpp/Duplication-of-Side-Effects.html
Best regards,
- Johannes
10-18-2016 09:59 AM
OK, thanks.
I'm just surprised that several features which were supported in CVI2013 are no longer supported in 2015. Is that when CVI started using CLANG instead of the old NI compiler ? (I thought it was earlier than that). Why isn't the full power of CLANG available ?
10-27-2016 08:30 AM
While I'm at it, there are several other things from C99 that seem to be missing from CVI, in particular all the newer math functions, such as hypot, fma, lrint, etc... Or do I have to include some extra file to get them ? Just enabling the C99 option is not enough.
And what about C11 (for type generic macros in particular) ? It's been over 5 years now ! And Clang mostly supports it.
10-27-2016 11:53 AM
Hi gdargaud,
The CVI compiler has been replaced with a Clang-based implementation starting with CVI 2013, responding to the need to provide a robust and modern toolchain that CVI customers can use to develop their applications. Still, from an investment standpoint or compatibility reasons, some features are not yet supported.
Which are the several features that you are refering to, which were supported in CVI 2013, but not anymore in CVI 2015?
Thanks,
- Johannes
10-28-2016 04:41 AM
Well, directly from the table you provided, there used to be support for complex numbers, compound litterals and binary const.
10-28-2016 06:53 AM
Hi gdargaud,
Fortunately, support for Complex numbers, compound literals and binary constants has been fixed in the CVI 2015 SP1 release. Please look for CARs 541058, 540675, and 539474 in the LabWindows™/CVI™ 2015 SP1 Bug Fix Information document.
Best regards,
- Johannes
06-23-2020 07:29 AM
Hi @Johannes_T,
the link to KB document is broken.
Can you fix, please?
06-23-2020 09:48 AM
Hi vix -
To recall, the KB under discussion is "What C Extensions Does LabWindows™/CVI™ 2013 and 2015 Support?"
I have reported the issue, for the broken link to get fixed as soon as possible.
If you see other problems with the ni.com website, you can use the "Site Feedback" button, located at the footer of every ni.com page, to report an issue.
In the meantime here are several alternatives:
I hope this was useful.
Best regards,
- Johannes
06-24-2020 12:50 AM
@Johannes_T wrote:
If you see other problems with the ni.com website, you can use the "Site Feedback" button, located at the footer of every ni.com page, to report an issue.
I can't see that button...