<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>GNU C Extensions on cge.dev</title>
    <link>https://cge.dev/tags/gnu-c-extensions/</link>
    <description>Recent content in GNU C Extensions on cge.dev</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 01 Feb 2025 22:15:16 -0800</lastBuildDate>
    <atom:link href="https://cge.dev/tags/gnu-c-extensions/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Array initialization with ranges in C</title>
      <link>https://cge.dev/posts/array-initialization-with-ranges-in-c/</link>
      <pubDate>Mon, 01 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://cge.dev/posts/array-initialization-with-ranges-in-c/</guid>
      <description>&lt;div class=&#34;notice note&#34;&gt;&#xA;  &lt;div class=&#34;notice-title&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-sticky-note&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;Note&#xA;  &lt;/div&gt;&#xA;  &lt;div class=&#34;notice-content&#34;&gt;This post is part of a new series of short-form posts titled &lt;strong&gt;&lt;a href=&#34;https://cge.dev/series/today-i-learned/&#34; &gt;Today I learned&lt;/a&gt;&lt;/strong&gt;. These posts are intended to be short and more informal—my goal is for you to learn one thing quickly.&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;https://cge.dev/series/today-i-learned/&#34; &gt;Today I learned&lt;/a&gt;&lt;/strong&gt; there is a &lt;a href=&#34;https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;GNU C extension&lt;/a&gt; for &lt;a href=&#34;https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;designated initializers&lt;/a&gt; that makes it possible to initialize a &lt;em&gt;range&lt;/em&gt; of elements in an array.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&lt;a href=&#34;images/range-example.webp&#34;&gt;&#xA;  &lt;img src=&#34;images/range-example.webp&#34; alt=&#34;range-example&#34; class=&#34;center&#34; /&gt;&#xA;&lt;/a&gt;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;If you happen to be using GCC (or another compatible compiler that supports this GNU extension, like Clang), you can specify a &lt;em&gt;range&lt;/em&gt; (&lt;code&gt;[first ... last]&lt;/code&gt;) in the designated initializer list.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
