{"provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/iww/","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fiww.hateblo.jp%2Fentry%2F20161030%2Fgcc\" title=\" error: cannot bind packed field &#39;a.hoge_t::n&#39; to &#39;int&amp;&#39; - \u63ee\u767a\u6027\u306e\u30e1\u30e2\uff12\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","categories":["C++"],"title":" error: cannot bind packed field 'a.hoge_t::n' to 'int&'","blog_url":"https://iww.hateblo.jp/","height":"190","url":"https://iww.hateblo.jp/entry/20161030/gcc","published":"2016-10-30 00:00:00","type":"rich","description":"\u30d1\u30c3\u30af\u3057\u305f\u69cb\u9020\u4f53\u306e\u30e1\u30f3\u30d0\u30fc\u306f\u3001\u53c2\u7167\u3067\u5229\u7528\u3067\u304d\u306a\u3044\u3002 #include <iostream> using namespace std; struct hoge_t{ int n; } __attribute__((__packed__)); void setan( int &n ){ n = 123; } int main() { hoge_t a; setan( a.n ); // \u2605\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc cout << a.n << endl; return 0; } prog.cpp: In function 'int main()': prog.cpp:14:14: error: canno\u2026","provider_name":"Hatena Blog","author_name":"iww","image_url":null,"blog_title":"\u63ee\u767a\u6027\u306e\u30e1\u30e2\uff12"}