<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/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>MSPM0 project with VS Code, CMake and GCC - part 6: empty &amp;quot;template&amp;quot; project</title><link>/technologies/embedded/b/blog/posts/mspm0-project-with-vs-code-cmake-and-gcc---part-6-empty-template-project</link><description>In this blog series, I build a Texas Instruments MSPM0 example with VS Code as IDE, and CMake as build infrastructure.In the previous posts, I created an end to end flow, from install over build to debug, tested on LaunchPad and EasyL1105 kit.In...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: MSPM0 project with VS Code, CMake and GCC - part 6: empty &amp;quot;template&amp;quot; project</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/mspm0-project-with-vs-code-cmake-and-gcc---part-6-empty-template-project</link><pubDate>Sat, 12 Sep 2026 17:16:13 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5f7b062e-d4a7-4507-920e-7335f22f1c09</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;A bit of AI help.&lt;/p&gt;
&lt;p&gt;The SDK uses a construct that throws a&amp;nbsp;lot of warnings in GCC 15. Because I&amp;#39;m not changing the SDK source, I tried to suppress it with:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;target_compile_options&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;${&lt;/span&gt;&lt;span&gt;CMAKE_PROJECT_NAME&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;PRIVATE&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;-Wno-volatile&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I got 1 remaining warning:&amp;nbsp;&lt;strong&gt;command-line option &amp;#39;-Wno-volatile&amp;#39; is valid for C++/ObjC++ but not for C&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s Google&amp;#39;s AI reply. It solved&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&amp;nbsp;command-line option &amp;#39;-Wno-volatile&amp;#39; is valid for C++/ObjC++ but not for C&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="n6owBd awi2gc" data-sfc-cp="" data-sfc-root="ep" data-hveid="CAAIBxAA" data-complete="true" data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;This warning or error occurs because the compiler flag -Wno-volatile is being passed to the &lt;strong class="rQesXe MPyX" data-sfc-cp="" data-sfc-root="ep" data-complete="true" data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 700; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;C compiler&lt;/strong&gt; (like gcc), but this specific flag only exists for the &lt;strong class="rQesXe MPyX" data-sfc-cp="" data-sfc-root="ep" data-complete="true" data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 700; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;C++ compiler&lt;/strong&gt; (like g++).&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="n6owBd awi2gc" data-sfc-cp="" data-sfc-root="ep" data-hveid="CAAICBAA" data-complete="true" data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;This usually happens when the flag is added to a global variable (such as CFLAGS or a shared build_flags configuration), forcing it onto all source files regardless of language.&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="yhAwj" data-sfc-cp="" data-sfc-root="ep" data-complete="true" data-processed="true" data-sfc-inited="2" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;&lt;/div&gt;
&lt;div class="otQkpb" data-animation-nesting="" data-sfc-cp="" data-wiz-attrbind="aria-level=An6Rcc_19/fLk2Md" data-sfc-root="ep" data-complete="true" data-processed="true" data-sae="" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 20px; font-weight: 600; margin: 24px 0px 12px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;How to Fix It&lt;/div&gt;
&lt;div class="n6owBd awi2gc" data-sfc-cp="" data-sfc-root="ep" data-hveid="CAAIChAA" data-complete="true" data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;You need to ensure this flag is &lt;strong class="rQesXe MPyX" data-sfc-cp="" data-sfc-root="ep" data-complete="true" data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 700; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;only passed to C++ compilations&lt;/strong&gt;. Here is how to fix it depending on your build tool:&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="yhAwj" data-sfc-cp="" data-sfc-root="ep" data-complete="true" data-processed="true" data-sfc-inited="2" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;&lt;/div&gt;
&lt;div class="AdPoic" data-animation-nesting="" data-sfc-cp="" data-wiz-attrbind="aria-level=An6Rcc_1i/fLk2Md" data-sfc-root="ep" data-complete="true" data-processed="true" data-sae="" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 700; margin: 24px 0px 12px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;1. In CMake&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="n6owBd awi2gc" data-sfc-cp="" data-sfc-root="ep" data-hveid="CAAIDBAA" data-complete="true" data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;Instead of using a global compiler definition, restrict the flag using a language-specific generator expression with target_compile_options:&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="yhAwj" data-sfc-cp="" data-sfc-root="ep" data-complete="true" data-processed="true" data-sfc-inited="2" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;&lt;/div&gt;
&lt;div class="r1PmQe" data-sfc-cp="" data-sfc-root="ep" data-wiz-uids="An6Rcc_1y,An6Rcc_1x" data-hveid="CAAIDRAA" data-complete="true" data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 14px; font-weight: 400; margin: 4px 0px 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;
&lt;div data-processed="true" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;
&lt;div class="pHpOfb" data-animation-atomic="" data-sae="" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 1px solid rgb(240, 242, 245);"&gt;
&lt;div class="z0e9Qd" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;
&lt;div class="vVRw1d" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 20px; font-weight: 500; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;cmake&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pCTyYe" dir="ltr" data-copy-service-computed-style="font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;
&lt;pre data-copy-service-computed-style="font-family: monospace; font-size: 14px; font-weight: 400; margin: 14px 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;&lt;span class="mexSqb" data-copy-service-computed-style="font-family: monospace; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(147, 52, 230);"&gt;target_compile_options&lt;/span&gt;&lt;span class="undefined" data-copy-service-computed-style="font-family: monospace; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);"&gt;(your_target_name PRIVATE
    $&amp;lt;$&amp;lt;COMPILE_LANGUAGE:CXX&amp;gt;:-Wno-volatile&amp;gt;
)&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=30182&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>