{"id":8771,"date":"2026-05-19T13:23:29","date_gmt":"2026-05-19T04:23:29","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=8771"},"modified":"2026-05-19T13:57:13","modified_gmt":"2026-05-19T04:57:13","slug":"c%e8%a8%80%e8%aa%9e-%e7%bf%bb%e8%a8%b3%e5%8d%98%e4%bd%8d","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/8771","title":{"rendered":"[C\u8a00\u8a9e] \u7ffb\u8a33\u5358\u4f4d"},"content":{"rendered":"<p>Translation Unit. <\/p>\n<h3>\u6a19\u6e96\u7684\u306a\u7ffb\u8a33\u5358\u4f4d<\/h3>\n<ul>\n<li>\uff11\u3064\u306e\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb (<code>*.c<\/code>)<\/li>\n<li>\u4e0a\u8a18\u306e\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3055\u308c\u305f\u5168\u3066\u306e\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb (<code>*.h<\/code>)\n<ul>\n<li>\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u304b\u3089\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3055\u308c\u305f\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb\u3082\u5168\u3066\u542b\u3080\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p>\u4f46\u3057\u3001\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u3088\u3063\u3066\u9664\u5916\u3055\u308c\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\uff08\u6761\u4ef6\u4ed8\u304d\u30b3\u30f3\u30d1\u30a4\u30eb <code>#if<\/code> \uff5e <code>#endif<\/code> \u306a\u3069\uff09\u306f\u7ffb\u8a33\u5358\u4f4d\u304b\u3089\u53d6\u308a\u9664\u304b\u308c\u308b\u3002<\/p>\n<h3>\u30b9\u30b3\u30fc\u30d7<\/h3>\n<p>\u7ffb\u8a33\u5358\u4f4d\u306f\u95a2\u6570\u3084\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u306e\u5883\u754c\u3068\u306a\u308b\u3002<\/p>\n<h4>\u8a18\u61b6\u30af\u30e9\u30b9\u6307\u5b9a\u5b50<\/h4>\n<table>\n<tbody>\n<tr>\n<th style=\"text-align: center;\" width=\"120px\">\u8a18\u61b6\u30af\u30e9\u30b9\u6307\u5b9a\u5b50<\/th>\n<th style=\"text-align: center;\" width=\"60px\">\u610f\u5473<\/th>\n<th style=\"text-align: center;\">\u6982\u8981<\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">static<\/td>\n<td style=\"text-align: center;\">\u5185\u90e8\u7d50\u5408<\/td>\n<td>static\u3067\u4fee\u98fe\u3057\u305f\u5909\u6570\u3084\u95a2\u6570\u3092\u73fe\u5728\u306e\u7ffb\u8a33\u5358\u4f4d\u5185\u3067\u306e\u307f\u6709\u52b9\u306b\u3059\u308b\uff08\u5916\u90e8\u304b\u3089\u96a0\u3059\uff09\u3002  <\/tr>\n<tr>\n<td style=\"text-align: center;\">extern<\/td>\n<td style=\"text-align: center;\">\u5916\u90e8\u7d50\u5408<\/td>\n<td>extern\u3067\u4fee\u98fe\u3057\u305f\u5909\u6570\u3084\u95a2\u6570\u304c\u4ed6\u306e\u7ffb\u8a33\u5358\u4f4d\uff08\u307e\u305f\u306f\u540c\u3058\u30d5\u30a1\u30a4\u30eb\u306e\u5225\u306e\u5834\u6240\uff09\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u4f1d\u3048\u308b\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u5185\u90e8\u30ea\u30f3\u30af<\/h3>\n<ul>\n<li><a href=\"\/tech\/index.php\/archives\/8030\">C\/C++\u306e\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8ff0\u3059\u3079\u304d\u5185\u5bb9\u3001\u8a18\u8ff0\u3059\u3079\u304d\u3067\u306a\u3044\u5185\u5bb9<\/a><\/li>\n<\/ul>\n<h3>\u5916\u90e8\u30ea\u30f3\u30af<\/h3>\n<ul>\n<li>Microsoft &nbsp;<a href=\"https:\/\/learn.microsoft.com\/ja-jp\/cpp\/cpp\/program-and-linkage-cpp\">\u7ffb\u8a33\u5358\u4f4d\u3068\u30ea\u30f3\u30b1\u30fc\u30b8<\/a><\/li>\n<li>JPCERT\/CC &nbsp;<a href=\"https:\/\/www.jpcert.or.jp\/sc-rules\/c-mem00-c.html\">\u30e1\u30e2\u30ea\u306e\u5272\u308a\u5f53\u3066\u3068\u89e3\u653e\u306f\u3001\u540c\u3058\u7ffb\u8a33\u5358\u4f4d\u5185\u306e\u540c\u4e00\u62bd\u8c61\u30ec\u30d9\u30eb\u3067\u884c\u3046<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Translation Unit. \u6a19\u6e96\u7684\u306a\u7ffb\u8a33\u5358\u4f4d \uff11\u3064\u306e\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb (*.c) \u4e0a\u8a18\u306e\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3055\u308c\u305f\u5168\u3066\u306e\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb (*.h) \u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u304b\u3089\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3055\u308c\u305f\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb\u3082 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[80],"class_list":["post-8771","post","type-post","status-publish","format-standard","hentry","category-memo","tag-c"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/8771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=8771"}],"version-history":[{"count":32,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/8771\/revisions"}],"predecessor-version":[{"id":8811,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/8771\/revisions\/8811"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=8771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=8771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=8771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}