summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/_0040encode.html
blob: 8718619f4abadb93b4e2e16141b0f22f4f07da8f (plain)
1
2
3
4
5
6
<div class="subsection-level-extent" id="g_t_0040encode"> <div class="nav-panel"> <p> Next: <a href="method-signatures" accesskey="n" rel="next">Method Signatures</a>, Previous: <a href="legacy-type-encoding" accesskey="p" rel="prev">Legacy Type Encoding</a>, Up: <a href="type-encoding" accesskey="u" rel="up">Type Encoding</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div>  <h1 class="subsection" id="g_t_0040encode-1"><span>8.3.2 @encode<a class="copiable-link" href="#g_t_0040encode-1"> ¶</a></span></h1> <p>GNU Objective-C supports the <code class="code">@encode</code> syntax that allows you to create a type encoding from a C/Objective-C type. For example, <code class="code">@encode(int)</code> is compiled by the compiler into <code class="code">"i"</code>. </p> <p><code class="code">@encode</code> does not support type qualifiers other than <code class="code">const</code>. For example, <code class="code">@encode(const char*)</code> is valid and is compiled into <code class="code">"r*"</code>, while <code class="code">@encode(bycopy char *)</code> is invalid and will cause a compilation error. </p> </div><div class="_attribution">
  <p class="_attribution-p">
    &copy; Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
    <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/_0040encode.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/_0040encode.html</a>
  </p>
</div>