C23 (C言語)
![]() | この項目「C23 (C言語)」は翻訳されたばかりのものです。不自然あるいは曖昧な表現などが含まれる可能性があり、このままでは読みづらいかもしれません。(原文:英語版 "C23 (C standard revision)" 2024年11月2日 (土) 08:03 (UTC)) 修正、加筆に協力し、現在の表現をより自然な表現にして下さる方を求めています。ノートページや履歴も参照してください。(2024年11月) |
![]() | 原文と比べた結果、この記事には多数の(または内容の大部分に影響ある)誤訳があることが判明しています。情報の利用には注意してください。(2024年11月) |
C23(ISO/IEC 9899:2024)とは、C言語の現在のオープン標準であり、C17(ISO/IEC 9899:2018)の後継規格である[1]。2016年にC2xとして非公式に策定が開始され[2]、2024年10月31日に発行された[3]。発行された規格に最も近い自由に入手できる草案はN3220である(#利用可能な文書を参照)[4]。C2x草案の最初のWG14会議は2019年10月に開催され[5]、新型コロナウイルス感染症の世界的流行によって2020年は仮想リモート会議として開催され、その後、2024年まで様々な遠隔会議が継続的に開催された。
C23では、__STDC_VERSION__
の値が201710L
から202311L
に変更される。一般名の「C17」や「C23」はISO規格識別子の年(9899:2018と9899:2024)ではなく、規格発行前に固定されるこれらの値を反映している。
機能
C23の最新の作業草案に統合された変更点は以下の通りである[6]。
標準ライブラリ
新規関数
<string.h>
にmemset_explicit()
関数を追加[7]。機密データを消去する目的で、最適化に関係なく常にメモリ書き込み (store) を実行する必要がある場面で使用される。<string.h>
にmemccpy()
関数を追加[8]。文字列を効率的に連結する。POSIXとSVIDのC拡張と同様である。<string.h>
にstrdup()
およびstrndup()
関数を追加[9]。文字列の複製を割り当てる。POSIXとSVIDのC拡張と同様である。- ポインタのバイトアライメントを決定するために
<stdlib.h>
にmemalignment()
関数を追加[10]。 - 新たなヘッダの
<stdbit.h>
を追加し、多くの整数型でビット関連の操作をするための関数、マクロ、データ型を定義。全てstdc_
で始まるので古いコードやサードパーティのライブラリとの競合を最小限に抑えることができる[11]。- 以下の
*
は特定の整数型向けの関数ではこれをuc
、us
、ui
、ul
、ull
のいずれかに置き換え、ジェネリック関数ではこれを除去して読む[11]。 - ビットで表現した場合の1または0の個数を数える
stdc_count_ones*()
およびstdc_count_zeros*()
関数を追加[11]。 - ビットで表現した場合の先頭の1または0の個数を数える
stdc_leading_ones*()
およびstdc_leading_zeros*()
関数を追加[11]。 - ビットで表現した場合の末尾の1または0の個数を数える
stdc_trailing_ones*()
およびstdc_trailing_zeros*()
関数を追加[11]。 - ビットで表現した場合に最上位ビットから数えて最初に1または0が現れる位置を探す
stdc_first_leading_one*()
およびstdc_first_leading_zero*()
関数を追加[11]。 - ビットで表現した場合に最下位ビットから数えて最初に1または0が現れる位置を探す
stdc_first_trailing_one*()
およびstdc_first_trailing_zero*()
関数を追加[11]。 - 値が正しく2の冪乗であるかを確認する(単一のビットだけが1の場合に
true
を返す)stdc_has_single_bit*()
関数を追加[11]。 - 与えられた値より大きくない最大の2の累乗を計算する
stdc_bit_floor*()
関数を追加[11]。 - 与えられた値より小さくない最小の2の累乗を計算する
stdc_bit_ceil*()
関数を追加[11]。 - 与えられた値を表すのに必要なビット数を調べる
stdc_bit_width*()
関数を追加[11]。
- 以下の
<time.h>
にglibcとmuslにあるような時間を表す構造体をtime_t
に変換できるtimegm()
関数を追加する[12]。<math.h>
にIEEE 754-2019の推奨に基づく以下のコンパイラはC23に実験的に対応しており、これを利用するためのオプションを提供している:
利用可能な文書
C17などの他のC言語の標準規格と同様に、C23のISOの公式規格書は自由に入手することはできない。
C23の仕様が確定する前の最後の作業草案は2023年4月1日付のN3096である[6]。この草案の後の数カ月間、2023年7日9日付の作業草案N3149と2024年2月22日付の公式標準草案N3219が作成されるまでに数百の変更[71]が行われた[71][72]。これら以降の草案は非公開である[71][72]。
標準草案N3219が発表されたのと同日、新たな作業草案N3220[4]が公開された。この草案は公式には将来のC言語の標準である「C2Y」の草案であると説明[72]されているが、付随する「編集者レポート」では、N3219との違いは付録Kの1つの脚注の修正だけであると明記されている[72]。
参考文献
- N3096 (last freely-available working draft before C23); WG14; April 2023. (free download)
- N3149 (working draft of C23 standard); WG14; July 2023. (not available to public)
- N3219 (ISO/IEC 9899:2023 DIS Draft); WG14; February 2024. (ISO draft available but not free)
- ISO/IEC 9899:2024 (official C23 standard); ISO; 2024. (planning for release in 2024)
- N3220 (first working draft after C23; differs from draft standard N3219 only in one footnote[72]); WG14; February 2024. (free download)
脚注
- ^ “History of C”. cppreference.com (2022年6月27日). October 19, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2086: C2x Charter”. open-std.org (2016年9月20日). December 22, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “ISO/IEC PRF 9899”. iso.org. September 19, 2024時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ a b “ISO/IEC 9899:2024 (en) — N3220 working draft”. open-std.org (2024年2月22日). 2024年11月10日閲覧。
- ^ “WG14-N2437: Agenda for October 2019”. open-std.org (2019年10月21日). March 5, 2021時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ a b “WG14-N3096: Draft for ISO/IEC 9899:2024”. open-std.org (April 1, 2023). April 2, 2023時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2897: memset_explicit()”. open-std.org (2021年12月27日). October 25, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2349: Toward more efficient string copying and concatenation”. open-std.org (2019年3月18日). September 30, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2353: strdup() and strndup()”. open-std.org (2019年3月18日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2974: Queryable pointer alignment”. open-std.org (2022年4月15日). October 13, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ a b c d e f g h i j k “WG14-N3022: Modern Bit Utilities”. open-std.org (2022年7月6日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2833: Add timegm() as non-optional part of time.h”. open-std.org (2021年10月7日). December 1, 2021時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ See N3096 § B.11 for a useful overview. The functions were added in separate documents: N2488, its updated versions, and its refs.
- ^ a b c “WG14-N2630: formatted input/output of binary integer numbers”. open-std.org (2021年1月1日). December 14, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3020: Qualifier-preserving standard library functions”. open-std.org (2022年6月13日). October 13, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ a b “WG14-N2645: Add support for preprocessing directives #elifdef and #elifndef”. open-std.org (2020年1月25日). November 28, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “GCC 12 Adds Support For New #elifdef #elifndef Directives”. phoronix (May 12, 2021). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3017: #embed - a scannable, tooling-friendly binary resource inclusion mechanism”. open-std.org (2022年6月27日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2686: #warning”. open-std.org (2022年7月22日). November 28, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2799: __has_include for C”. open-std.org (2021年8月30日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2553: Querying attribute support”. open-std.org (2020年8月4日). October 14, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3033: Comma omission and comma deletion”. open-std.org (2022年7月20日). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ a b “WR14-N3042: Introduce the nullptr constant”. open-std.org (2022年7月22日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2763: Adding a Fundamental Type for N-bit integers”. open-std.org (2021年6月21日). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3035: _BitInt Fixes”. open-std.org (2022年7月21日). October 13, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2867: Checked N-Bit Integers”. open-std.org (2021年11月28日). December 14, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2778: Variably-Modified Types”. open-std.org (2021年7月11日). December 22, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2607: Compatibility of Pointers to Arrays with Qualifiers”. open-std.org (2020年10月31日). October 13, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2899: Not-so-magic - typeof for C”. open-std.org (2022年1月21日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3007: Type inference for object definitions”. open-std.org (2022年6月10日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3037: Improved Rules for Tag Compatibility (updates N3032)”. 2024年11月10日閲覧。
- ^ “C23 is Finished: Here is What is on the Menu” (英語). The Pasture (31 July 2022). 2024年11月10日閲覧。
- ^ “WG14-N2775: Literal suffixes for bit-precise integers”. open-std.org (2021年7月13日). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2549: Allow for binary integer constants”. open-std.org (2020年7月30日). December 22, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2626: Digit separators”. open-std.org (2020年12月15日). December 19, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3030: Enhancements to Enumerations”. open-std.org (2022年7月19日). November 26, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3029: Improved Normal Enumerations”. open-std.org (2022年7月19日). January 29, 2023時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2935: Make false and true first-class language features”. open-std.org (2022年2月15日). November 21, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2934: Revise spelling of keywords”. open-std.org (2022年2月15日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2508: Free Positioning of Labels Inside Compound Statements”. open-std.org (2020年3月28日). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2510: Allowing unnamed parameters in a function definition”. open-std.org (2020年4月9日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2900: Consistent, Warningless, and Intuitive Initialization with {}”. open-std.org (2022年1月1日). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2975: Relax requirements for variadic parameter lists”. open-std.org (2022年4月15日). November 28, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2335: Attributes in C”. open-std.org (2019年3月9日). October 26, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ a b “Unsequenced functions”. open-std.org. 2024年7月18日閲覧。
- ^ “WG14-N2265: Harmonizing static_assert with C++”. open-std.org (2018年7月6日). March 28, 2023時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “Labels at the end of compound statements (C compatibility)” (2022年1月13日). 2024年11月10日閲覧。
- ^ “WG14-N2334: The deprecated attribute”. open-std.org (2019年1月22日). October 19, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2408: The fallthrough attribute”. open-std.org (2019年8月11日). December 25, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2270: The maybe_unused attribute”. open-std.org (2018年7月6日). December 25, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2267: The nodiscard attribute”. open-std.org (2018年7月6日). October 19, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2554: Minor attribute wording cleanups”. open-std.org (2020年8月4日). November 28, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2764: The noreturn attribute”. open-std.org (2021年6月21日). December 25, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2557: Allow Duplicate Attributes”. open-std.org (2020年9月1日). November 28, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2418: Adding the u8 character prefix”. open-std.org (2019年9月2日). January 13, 2023時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “What is the point of the UTF-8 character literals proposed for C++17?” (英語). Stack Overflow. 2024年11月10日閲覧。
- ^ “WG14-N2341: ISO/IEC TS 18661-2 - Floating-point extensions for C - Part 2: Decimal floating-point arithmetic”. open-std.org (February 26, 2019). November 21, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2601: Annex X - IEC 60559 interchange and extended types”. open-std.org (October 15, 2020). October 14, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3018: The constexpr specifier for object definitions”. open-std.org (2022年7月6日). December 24, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2653: char8_t: A type for UTF-8 characters and strings (Revision 1)”. open-std.org (2021年6月4日). May 27, 2023時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2728: char16_t & char32_t string literals shall be UTF-16 & UTF-32”. open-std.org (2021年5月15日). May 27, 2023時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N3038: Introduce storage-class specifiers for compound literals”. open-std.org (2022年7月21日). November 26, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2940: Removing trigraphs??!”. open-std.org (2022年3月2日). October 26, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2432: Remove support for function definitions with identifier lists proposal”. open-std.org (September 25, 2019). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2841: No function declarators without prototypes”. open-std.org (2021年10月10日). November 12, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2412: Two's complement sign representation”. open-std.org (August 11, 2019). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “WG14-N2993: Make *_HAS_SUBNORM be obsolescent”. open-std.org (2022年6月6日). December 5, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “GCC 9 Release Notes”. GNU Project. December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “Clang 9.0 - add new language mode for C2x”. LLVM Project Repository (May 14, 2019). December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ “Pelles C - major changes between 10.00 and 11.00”. smorgasbordet.com. December 27, 2022時点のオリジナルよりアーカイブ。2024年11月10日閲覧。
- ^ a b c “N3150 - Editor's Report, Post January-February 2023 Meeting”. open-std.org (2023年7月8日). 2024年11月10日閲覧。
- ^ a b c d e “N3221 - Editor's Report, Post January 2024 Meeting”. open-std.org (2024年2月15日). 2024年11月10日閲覧。
関連項目
外部リンク
- C Language WG14 (Working Group 14)
- WG14 Document Repository
- WG14 Meetings - agenda and minutes
- WG14 Charters: C2x Charter, C23 Charter, Interpreting the C23 Charter, C Standard Charter
C-23
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2019/10/14 00:30 UTC 版)
愛称はシェルパ。胴体後部に大型化した貨物扉を設置。アメリカ軍等で運用。
※この「C-23」の解説は、「ショート 330」の解説の一部です。
「C-23」を含む「ショート 330」の記事については、「ショート 330」の概要を参照ください。
「C-23」に関係したコラム
FXのチャート分析ソフトMT4で10分足や2時間足などを表示するには
FX(外国為替証拠金取引)のチャート分析ソフトMT4(Meta Trader 4)では、次の時間足の表示ができます。ティック1分足5分足15分足30分足1時間足4時間足日足週足MT4では、10分足や1...
- C-23のページへのリンク