New C features in GCC 13 (Red Hat Developer)
New C features in GCC 13 (Red Hat Developer)
Posted May 5, 2023 0:56 UTC (Fri) by branden (guest, #7029)In reply to: New C features in GCC 13 (Red Hat Developer) by ceplm
Parent article: New C features in GCC 13 (Red Hat Developer)
With a plain "int" you get an integer of whatever size the platform feels like providing. Is it a fast int? Is it a small int? Undefined.
Posted May 5, 2023 6:56 UTC (Fri)
by mb (subscriber, #50428)
[Link] (7 responses)
Posted May 5, 2023 9:35 UTC (Fri)
by ballombe (subscriber, #9523)
[Link] (5 responses)
Posted May 5, 2023 10:03 UTC (Fri)
by adobriyan (subscriber, #30858)
[Link] (1 responses)
Posted May 5, 2023 22:40 UTC (Fri)
by bartoc (guest, #124262)
[Link]
Posted May 5, 2023 10:05 UTC (Fri)
by hkario (subscriber, #94864)
[Link]
Posted May 5, 2023 12:57 UTC (Fri)
by HenrikH (subscriber, #31152)
[Link] (1 responses)
Posted May 5, 2023 15:19 UTC (Fri)
by magfr (subscriber, #16052)
[Link]
GCC on x86_64 have supported _int128 for years but glibc have not.
Posted May 10, 2023 0:36 UTC (Wed)
by DemiMarie (subscriber, #164188)
[Link]
New C features in GCC 13 (Red Hat Developer)
And the fast/least types are BS. Sprinkling the code with ugly fast-types doesn't make it any faster. It just increases the likelihood of subtle bugs due to actual type size differences between platforms.
Just use fixed types like uint32_t.
New C features in GCC 13 (Red Hat Developer)
New C features in GCC 13 (Red Hat Developer)
New C features in GCC 13 (Red Hat Developer)
New C features in GCC 13 (Red Hat Developer)
New C features in GCC 13 (Red Hat Developer)
New C features in GCC 13 (Red Hat Developer)
intmax_t tend to get frozen when ABIs are set and afterwards they wont change even if the compiler supports wider types.
Some embedded platforms do not define all of the fixed-size integer types! For instance, some DSPs cannot access individual bytes, so New C features in GCC 13 (Red Hat Developer)
char is 16 bits and uint8_t doesn’t exist. int_least8_t could be useful for documentation there.
