<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>w_o</author_name>
  <author_url>https://blog.hatena.ne.jp/w_o/</author_url>
  <blog_title>w_o’s diary</blog_title>
  <blog_url>https://w0.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>GCC拡張を使えばCもクロージャが使える。 int retfunc( int x ) { int a = 20; int hogehoge( ) { return a; } return hogehoge(); }GCC拡張で、ネストした関数は、外側のスコープの変数を参照できる、というのは有名な話かと思う。 これの実装は結構面白くて、スタックの上に、フレームをロードしたあと、関数を呼び出すプログラムを実行時に生成して、それを関数ポインタとする、というようになっている。 （どっか解説有るかなーっと思ったけど見つからないな…google:gcc trampolineとかを漁ってみるとよいかもしれな…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fw0.hatenablog.com%2Fentry%2F20060808%2Fp2&quot; title=&quot; Cでクロージャ - w_o’s diary&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2006-08-08 00:00:02</published>
  <title> Cでクロージャ</title>
  <type>rich</type>
  <url>https://w0.hatenablog.com/entry/20060808/p2</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
