{"id":1266,"date":"2011-09-15T14:35:20","date_gmt":"2011-09-15T05:35:20","guid":{"rendered":"https:\/\/wp-78qb7hnp.pistolfly.jp\/weblog\/2011\/09\/post-131.html"},"modified":"2016-03-26T23:40:42","modified_gmt":"2016-03-26T14:40:42","slug":"post-131","status":"publish","type":"post","link":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html","title":{"rendered":"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b"},"content":{"rendered":"<p>gdb\u306eptype\u3092\u4f7f\u3046\u306e\u304c\u7c21\u5358\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306efoo.c\u3002<\/p>\n<pre class=\"prettyprint\">#include &lt;sys\/types.h&gt;\r\nstruct st { int i; char c; };\r\ntypedef int Array[10];\r\ntypedef struct st St;\r\nint main(void)\r\n{ \r\n  size_t s1;\r\n  ssize_t s2;\r\n  pid_t pid;\r\n  Array arr;\r\n  St st1;\r\n  return 0;\r\n}\r\n<\/pre>\n<pre class=\"command-line\">$ gcc -Wall -g -o foo foo.c\r\n$ gdb foo\r\n(gdb) b main\r\n(gdb) run\r\n(gdb) ptype s1\r\ntype = long unsigned int\r\n(gdb) ptype size_t\r\ntype = long unsigned int\r\n(gdb) ptype s2\r\ntype = long int\r\n(gdb) ptype ssize_t \r\ntype = long int\r\n(gdb) ptype pid\r\ntype = int\r\n(gdb) ptype pid_t\r\ntype = int\r\n(gdb) ptype arr\r\ntype = int [10]\r\n(gdb) ptype Array \r\ntype = int [10]\r\n(gdb) ptype st1\r\ntype = struct st {\r\n    int i;\r\n    char c;\r\n}\r\n(gdb) ptype St\r\ntype = struct st {\r\n    int i;\r\n    char c;\r\n}\r\n<\/pre>\n<p>\u306e\u3088\u3046\u306b\u3001<br \/>\nptype \u5f0f\u3084\u578b\u540d<br \/>\n\u3067\u5b9f\u969b\u306e\u578b\u304c\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n\u914d\u5217\u306e\u5834\u5408\u306f\u30b5\u30a4\u30ba\u304c\u8868\u793a\u3055\u308c\u308b\u3057\u3001\u69cb\u9020\u4f53\u306e\u5834\u5408\u306f\u30e1\u30f3\u30d0\u306e\u578b\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u4fbf\u5229\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001gcc\u306e-E\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u306e\u51fa\u529b\u8abf\u3079\u3066\u3082\u5206\u304b\u308a\u305d\u3046\u3060\u304c\u3001\u9762\u5012\u304f\u3055\u3044\u3057\u3001\u8ffd\u3044\u5207\u308c\u306a\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<pre class=\"command-line\">$ gcc -E foo.c | grep ssize_t\r\ntypedef long int __ssize_t;\r\ntypedef __ssize_t ssize_t;\r\n(\u4ee5\u4e0b\u7565)\r\n<\/pre>\n<p>\u3053\u306e\u30b7\u30b9\u30c6\u30e0(x86_64 GNU\/Linux)\u3067\u306f\u3001ssize_t\u306f<br \/>\n__ssize_t => long int<\/p>\n<pre class=\"command-line\">$ gcc -E foo.c | grep ssize_t\r\ntypedef long __darwin_ssize_t;\r\n(\u4e2d\u7565)\r\ntypedef __darwin_ssize_t ssize_t;\r\n(\u4ee5\u4e0b\u7565)\r\n<\/pre>\n<p>\u3053\u306e\u30b7\u30b9\u30c6\u30e0(Mac OS X)\u3067\u306f\u3001ssize_t\u306f<br \/>\nssize_t => __darwin_ssize_t => long<br \/>\n\u3067\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>gdb\u306eptype\u3092\u4f7f\u3046\u306e\u304c\u7c21\u5358\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306efoo.c\u3002 #include &lt;sys\/types.h&gt; struct st { int i; char c; }; typedef int Array[1 &hellip; <a href=\"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"1266","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[53],"tags":[],"class_list":["post-1266","post","type-post","status-publish","format-standard","hentry","category-c","ja"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b - Pistolfly<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b - Pistolfly\" \/>\n<meta property=\"og:description\" content=\"gdb\u306eptype\u3092\u4f7f\u3046\u306e\u304c\u7c21\u5358\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306efoo.c\u3002 #include &lt;sys\/types.h&gt; struct st { int i; char c; }; typedef int Array[1 &hellip; \u7d9a\u304d\u3092\u8aad\u3080 \u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html\" \/>\n<meta property=\"og:site_name\" content=\"Pistolfly\" \/>\n<meta property=\"article:published_time\" content=\"2011-09-15T05:35:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-26T14:40:42+00:00\" \/>\n<meta name=\"author\" content=\"Pistolfly\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pistolfly\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html\"},\"author\":{\"name\":\"Pistolfly\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"headline\":\"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b\",\"datePublished\":\"2011-09-15T05:35:20+00:00\",\"dateModified\":\"2016-03-26T14:40:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html\"},\"wordCount\":28,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"articleSection\":[\"C\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html\",\"name\":\"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b - Pistolfly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\"},\"datePublished\":\"2011-09-15T05:35:20+00:00\",\"dateModified\":\"2016-03-26T14:40:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2011\\\/09\\\/post-131.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/\",\"name\":\"Pistolfly\",\"description\":\"Developer Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\",\"name\":\"Pistolfly\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"caption\":\"Pistolfly\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\"},\"description\":\"Software Engineer in Tokyo, Japan\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/author\\\/pistolfly\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b - Pistolfly","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html","og_locale":"ja_JP","og_type":"article","og_title":"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b - Pistolfly","og_description":"gdb\u306eptype\u3092\u4f7f\u3046\u306e\u304c\u7c21\u5358\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306efoo.c\u3002 #include &lt;sys\/types.h&gt; struct st { int i; char c; }; typedef int Array[1 &hellip; \u7d9a\u304d\u3092\u8aad\u3080 \u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b &rarr;","og_url":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html","og_site_name":"Pistolfly","article_published_time":"2011-09-15T05:35:20+00:00","article_modified_time":"2016-03-26T14:40:42+00:00","author":"Pistolfly","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"Pistolfly","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html#article","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html"},"author":{"name":"Pistolfly","@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"headline":"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b","datePublished":"2011-09-15T05:35:20+00:00","dateModified":"2016-03-26T14:40:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html"},"wordCount":28,"commentCount":0,"publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"articleSection":["C"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html","url":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html","name":"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b - Pistolfly","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#website"},"datePublished":"2011-09-15T05:35:20+00:00","dateModified":"2016-03-26T14:40:42+00:00","breadcrumb":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pistolfly.com\/weblog\/2011\/09\/post-131.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/www.pistolfly.com\/weblog"},{"@type":"ListItem","position":2,"name":"\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u578b\u306a\u3069typedef\u3055\u308c\u305f\u578b\u306e\u5b9f\u969b\u306e\u578b\u3092\u8abf\u3079\u308b"}]},{"@type":"WebSite","@id":"https:\/\/www.pistolfly.com\/weblog\/#website","url":"https:\/\/www.pistolfly.com\/weblog\/","name":"Pistolfly","description":"Developer Blog","publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pistolfly.com\/weblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab","name":"Pistolfly","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","caption":"Pistolfly"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g"},"description":"Software Engineer in Tokyo, Japan","url":"https:\/\/www.pistolfly.com\/weblog\/author\/pistolfly"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paorzz-kq","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/1266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/comments?post=1266"}],"version-history":[{"count":2,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/1266\/revisions"}],"predecessor-version":[{"id":3447,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/1266\/revisions\/3447"}],"wp:attachment":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/media?parent=1266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/categories?post=1266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/tags?post=1266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}