<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Error when compiling with the samd21.h library with C++ language</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/47662/error-when-compiling-with-the-samd21-h-library-with-c-language</link><description> hello, good morning everybody! i have some doubts about this, i&amp;#39;m using an ATMEL SAMD2 microcontroller, i&amp;#39;m new to this compiler and they let me handle this micro in keil uvision. I tried to make a library handling C++ language but I get these errors</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Error when compiling with the samd21.h library with C++ language</title><link>https://community.arm.com/thread/167590?ContentTypeID=1</link><pubDate>Fri, 18 Sep 2020 23:55:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:80167561-a5b2-4d23-9b28-5444a0434193</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;C++ is not a proper superset of C - there are&amp;nbsp;a few things that are allowed in &amp;#39;C&amp;#39;, but not in C++.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;anonymous bit-fields with qualifiers&amp;quot; would be one of them ...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So &amp;#39;C&amp;#39; code which relies upon such things cannot just be compiled as C++&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Similar issues exist with some of Nordic&amp;#39;s SDK code.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when compiling with the samd21.h library with C++ language</title><link>https://community.arm.com/thread/167589?ContentTypeID=1</link><pubDate>Fri, 18 Sep 2020 19:31:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:74177601-ea54-4fcc-91d0-23d19ac9a319</guid><dc:creator>Adam Lins</dc:creator><description>&lt;p&gt;I&amp;#39;m using the SAMC21 libraries -- I just don&amp;#39;t include the SAMC21 header file in any C++ files, to avoid the compiler complaining about the header. I define functions in C files that use the information from the header (e.g., timer register access structures), and call those &amp;quot;helper&amp;quot; functions from the C++ code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when compiling with the samd21.h library with C++ language</title><link>https://community.arm.com/thread/167588?ContentTypeID=1</link><pubDate>Fri, 18 Sep 2020 18:16:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:08b35567-05e6-4d81-a781-f59fbf760947</guid><dc:creator>antouriel123</dc:creator><description>&lt;p&gt;Hello, Adam Lins! &lt;br /&gt;Thank you, I reviewed the document, so you don&amp;#39;t add the SAMC21 library as such? or what do you call it? I didn&amp;#39;t quite understand the solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when compiling with the samd21.h library with C++ language</title><link>https://community.arm.com/thread/167586?ContentTypeID=1</link><pubDate>Fri, 18 Sep 2020 17:00:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6a201f46-bb96-4319-beaf-02ea3996fbcf</guid><dc:creator>Adam Lins</dc:creator><description>&lt;p&gt;I hit this recently, too (on the SAMC21). ARMCLANG is built from Clang (naturally), and Clang addresses C++ DR2229 (see the list of C++ defects &lt;a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html"&gt;here&lt;/a&gt;). I&amp;#39;m not aware of a clang switch that can turn off the DR2229 fix.&lt;/p&gt;
&lt;p&gt;The solution I chose was to use C for the functionality that needed access to the things defined in samc21.h, and call those functions from my C++ code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>