C – Preliminary C2x Charter
This is cool!<p>I&#x27;m a pretty hardcore C programmer (been using it as my absolute main and favorite language for over 20 years), yet I find it hard to come up with some wishes for what I&#x27;d like to see.<p>Not sure how to interpret that, perhaps it&#x27;s just indicative of a certain ... conservatism common in old people? :) Scary thought!<p>To be brutally concrete, I sometimes wish I could write someting like this:<p><pre><code>    do {
      const bool flag = do_something();
      ...
      ...
    } while(!flag);
</code></pre>
That&#x27;d be very useful, but of course in current standards it&#x27;s not possible since &#x27;flag&#x27; isn&#x27;t valid outside the scope it&#x27;s declared in. So now we have to pre-declare &#x27;flag&#x27; before the loop, breaking const-cleanliness too of course. This is obviously not a show-stopper, it&#x27;s a minute thing. But it would be so nice! :)<p>Some support for automatic type inference would be nice, since most right-hand-side expressions have a type anyway it would be cool to be able to write<p><pre><code>    auto x = 3;
</code></pre>
and have the type of &#x27;x&#x27; be &#x27;int&#x27; since that is the type of the literal &#x27;3&#x27;. Of course re-using &quot;auto&quot; like this would break their guiding principle, but it would look great (and, I think, somewhat mimic what C++ has done to that keyword).<p>Does anyone have some better ideas?