> -----Original Message-----
> From: Xenomai <[email protected]> On Behalf Of Grau,
> Gunter via Xenomai
> Sent: Donnerstag, 5. Mai 2022 16:57
> To: [email protected]
> Subject: Can't compile userspace application with compiler switch -std=c++11
> and Xenomai 3.2
>
> Caution: This e-mail originated from outside of Philips, be careful for
> phishing.
>
>
> Hi,
>
> We are trying to port our application to Xenomai 3.2.
> The source is c++ and we use in some parts C++11 elements. Therefore the
> compile switch is set to -std=c++11.
> When now compiling with this option we see following output when using
> Xenomai 3.2:
>
> In file included from /home/delphi/sw/oss/IntelliVue-OSS-R18-
> FEATUREBUILD-5.4-Kernel-88/sdk-iv-monitor/target-
> sysroot/usr/xenomai/include/cobalt/semaphore.h:24,
> from /home/delphi/sw/oss/IntelliVue-OSS-R18-FEATUREBUILD-5.4-
> Kernel-88/sdk-iv-monitor/target-
> sysroot/usr/xenomai/include/cobalt/sys/cobalt.h:25,
> from /home/delphi/sw/oss/IntelliVue-OSS-R18-FEATUREBUILD-5.4-
> Kernel-88/sdk-iv-monitor/target-
> sysroot/usr/xenomai/include/copperplate/clockobj.h:113,
> from /home/delphi/sw/oss/IntelliVue-OSS-R18-FEATUREBUILD-5.4-
> Kernel-88/sdk-iv-monitor/target-
> sysroot/usr/xenomai/include/alchemy/timer.h:22,
> from /home/delphi/sw/oss/IntelliVue-OSS-R18-FEATUREBUILD-5.4-
> Kernel-88/sdk-iv-monitor/target-
> sysroot/usr/xenomai/include/alchemy/heap.h:22,
> from ../PROG/Test.cpp:39:
> /target-sysroot/usr/xenomai/include/cobalt/uapi/kernel/urw.h: In function
> 'void __try_read_start(const urw_t*, urwstate_t*)':
> /target-sysroot/usr/xenomai/include/cobalt/uapi/kernel/urw.h:57:19: error:
> expected primary-expression before 'volatile'
> #define READ_ONCE ACCESS_ONCE
> ^~~~~~~~~~~
> /target-sysroot/usr/xenomai/include/cobalt/uapi/kernel/urw.h:64:10: note:
> in expansion of macro 'READ_ONCE'
> token = READ_ONCE(urw->sequence);
> ^~~~~~~~~
> /target-sysroot/usr/xenomai/include/cobalt/uapi/kernel/urw.h:57:19: error:
> expected ')' before 'volatile'
> #define READ_ONCE ACCESS_ONCE
> ^~~~~~~~~~~
> /target-sysroot/usr/xenomai/include/cobalt/uapi/kernel/urw.h:64:10: note:
> in expansion of macro 'READ_ONCE'
> token = READ_ONCE(urw->sequence);
> ^~~~~~~~~
>
> This worked with Xenomai 3.1.
> It looks like the issue is related to the usage of "typeof" in the ACCESS_ONCE
> macro. This seems not to be allowed if you use -std option:
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgcc.g
> nu.org%2Fonlinedocs%2Fgcc%2FAlternate-Keywords.html%23Alternate-
> Keywords&data=04%7C01%7C%7C1dd88557c5d94977fc5a08da2ea79757
> %7C1a407a2d76754d178692b3ac285306e4%7C0%7C0%7C63787359458116553
> 7%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI
> iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=W8vcAhLswMlUE
> HddpjoZnNNT%2BumenFsVtq73oD7dKX8%3D&reserved=0
> I have now a workaround by defining a macro prior the inclusion of "heap.h":
> #define typeof __typeof__
> But I am not happy with this. Is there a way to do this better? Is -std now
> not
> allowed with Xenomai?
>
> Thanks,
> Gunter Grau
>
Hi,
Sorry. Forgot to add some testcode:
#include <iostream>
#include <heap.h>
int main() {
std::cout << "Hello World!";
return 0;
}
Since the issue comes with the include. No need to really use heap functions.
Please try to compile with alchemy skin.
Looks like it was introduced with the inclusion of "cobals/sys/cobalt.h" in
include/copperplate/clockobj.h in this commit:
dbda3c2c6e4b4eca052bb0cbbd059ead174f33cc
Thanks in advance,
Gunter
________________________________
The information contained in this message may be confidential and legally
protected under applicable law. The message is intended solely for the
addressee(s). If you are not the intended recipient, you are hereby notified
that any use, forwarding, dissemination, or reproduction of this message is
strictly prohibited and may be unlawful. If you are not the intended recipient,
please contact the sender by return e-mail and destroy all copies of the
original message.