No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

147 líneas
6.7KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Structures unions enumerations and bit-fields implementation (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="Structures unions enumerations and bit-fields implementation (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="Structures unions enumerations and bit-fields implementation (Using the GNU Compiler Collection (GCC))">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="C-Implementation.html#C-Implementation" rel="up" title="C Implementation">
  30. <link href="Qualifiers-implementation.html#Qualifiers-implementation" rel="next" title="Qualifiers implementation">
  31. <link href="Hints-implementation.html#Hints-implementation" rel="prev" title="Hints implementation">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Structures-unions-enumerations-and-bit_002dfields-implementation"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Qualifiers-implementation.html#Qualifiers-implementation" accesskey="n" rel="next">Qualifiers implementation</a>, Previous: <a href="Hints-implementation.html#Hints-implementation" accesskey="p" rel="prev">Hints implementation</a>, Up: <a href="C-Implementation.html#C-Implementation" accesskey="u" rel="up">C Implementation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Structures_002c-Unions_002c-Enumerations_002c-and-Bit_002dFields"></a>
  68. <h3 class="section">4.9 Structures, Unions, Enumerations, and Bit-Fields</h3>
  69. <ul>
  70. <li> <cite>A member of a union object is accessed using a member of a
  71. different type (C90 6.3.2.3).</cite>
  72. <p>The relevant bytes of the representation of the object are treated as
  73. an object of the type used for the access. See <a href="Optimize-Options.html#Type_002dpunning">Type-punning</a>. This
  74. may be a trap representation.
  75. </p>
  76. </li><li> <cite>Whether a &ldquo;plain&rdquo; <code>int</code> bit-field is treated as a
  77. <code>signed int</code> bit-field or as an <code>unsigned int</code> bit-field
  78. (C90 6.5.2, C90 6.5.2.1, C99 and C11 6.7.2, C99 and C11 6.7.2.1).</cite>
  79. <a name="index-funsigned_002dbitfields-1"></a>
  80. <p>By default it is treated as <code>signed int</code> but this may be changed
  81. by the <samp>-funsigned-bitfields</samp> option.
  82. </p>
  83. </li><li> <cite>Allowable bit-field types other than <code>_Bool</code>, <code>signed int</code>,
  84. and <code>unsigned int</code> (C99 and C11 6.7.2.1).</cite>
  85. <p>Other integer types, such as <code>long int</code>, and enumerated types are
  86. permitted even in strictly conforming mode.
  87. </p>
  88. </li><li> <cite>Whether atomic types are permitted for bit-fields (C11 6.7.2.1).</cite>
  89. <p>Atomic types are not permitted for bit-fields.
  90. </p>
  91. </li><li> <cite>Whether a bit-field can straddle a storage-unit boundary (C90
  92. 6.5.2.1, C99 and C11 6.7.2.1).</cite>
  93. <p>Determined by ABI.
  94. </p>
  95. </li><li> <cite>The order of allocation of bit-fields within a unit (C90
  96. 6.5.2.1, C99 and C11 6.7.2.1).</cite>
  97. <p>Determined by ABI.
  98. </p>
  99. </li><li> <cite>The alignment of non-bit-field members of structures (C90
  100. 6.5.2.1, C99 and C11 6.7.2.1).</cite>
  101. <p>Determined by ABI.
  102. </p>
  103. </li><li> <cite>The integer type compatible with each enumerated type (C90
  104. 6.5.2.2, C99 and C11 6.7.2.2).</cite>
  105. <a name="index-fshort_002denums-1"></a>
  106. <p>Normally, the type is <code>unsigned int</code> if there are no negative
  107. values in the enumeration, otherwise <code>int</code>. If
  108. <samp>-fshort-enums</samp> is specified, then if there are negative values
  109. it is the first of <code>signed char</code>, <code>short</code> and <code>int</code>
  110. that can represent all the values, otherwise it is the first of
  111. <code>unsigned char</code>, <code>unsigned short</code> and <code>unsigned int</code>
  112. that can represent all the values.
  113. </p>
  114. <p>On some targets, <samp>-fshort-enums</samp> is the default; this is
  115. determined by the ABI.
  116. </p>
  117. </li></ul>
  118. <hr>
  119. <div class="header">
  120. <p>
  121. Next: <a href="Qualifiers-implementation.html#Qualifiers-implementation" accesskey="n" rel="next">Qualifiers implementation</a>, Previous: <a href="Hints-implementation.html#Hints-implementation" accesskey="p" rel="prev">Hints implementation</a>, Up: <a href="C-Implementation.html#C-Implementation" accesskey="u" rel="up">C Implementation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  122. </div>
  123. </body>
  124. </html>