<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yupo5656</author_name>
  <author_url>https://blog.hatena.ne.jp/yupo5656/</author_url>
  <blog_title>memologue</blog_title>
  <blog_url>https://yupo5656.hatenadiary.org/</blog_url>
  <categories>
    <anon>binary</anon>
    <anon>C++</anon>
  </categories>
  <description>先日、次のようなC++のクラスが原因で少々悩みました。 struct A { #ifdef V2 int bar_; /* バージョン2以降でしか使わないメンバ変数(らしい) */ #endif int foo_; /* 以下略 */ }; このAを使っている.cppの一部は、g++ -DV2でコンパイルされており、残りは-DV2なしでコンパイルされていたのです。sizeof(A)が異なるオブジェクト同士がリンクされてしまい、まずいことになっていました。たとえば、次のようなa.hと、 // a.h struct A { #ifdef V2 int bar_; #endif int foo_; …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyupo5656.hatenadiary.org%2Fentry%2F20071105%2Fp2&quot; title=&quot; 構造体のサイズ違いで悩んだのでリンク時に検出 - memologue&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>2007-11-05 00:00:01</published>
  <title> 構造体のサイズ違いで悩んだのでリンク時に検出</title>
  <type>rich</type>
  <url>https://yupo5656.hatenadiary.org/entry/20071105/p2</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
