LoginSignup
0
2

C言語:未定義、未規定、処理系定義

Last updated at Posted at 2021-07-22

<この項は書きかけです。順次追記します。>
This article is not completed. I will add some words in order.

法律

法律と慣習

憲法

第十二条 この憲法が国民に保障する自由及び権利は、国民の不断の努力によつて、これを保持しなければならない。又、国民は、これを濫用してはならないのであつて、常に公共の福祉のためにこれを利用する責任を負ふ。

民法

(任意規定と異なる慣習)
第九十二条 法令中の公の秩序に関しない規定と異なる慣習がある場合において、法律行為の当事者がその慣習による意思を有しているものと認められるときは、その慣習に従う。

法の適用に関する通則法(旧 法例)

(法律と同一の効力を有する慣習)
第三条 公の秩序又は善良の風俗に反しない慣習は、法令の規定により認められたもの又は法令に規定されていない事項に関するものに限り、法律と同一の効力を有する。

商法

(趣旨等)
第一条 商人の営業、商行為その他商事については、他の法律に特別の定めがあるものを除くほか、この法律の定めるところによる。
2 商事に関し、この法律に定めがない事項については商慣習に従い、商慣習がないときは、民法(明治二十九年法律第八十九号)の定めるところによる。

法律は、規定がない場合は慣習に従うこと、慣習が法律と同一の効力を有することを宣言している。

法律と規格

WTO/TBT協定

WTO(world trade organization:国際貿易機構)/TBT(TECHNICAL BARRIERS TO TRADE:貿易の技術的障害に関する)協定

加盟国は、強制規格を必要とする場合において、関連する国際規格が存在するとき又はその仕上がりが目前であるときは、当該国際規格又はその関連部分を強制規格の基礎として用いる。ただし、気候上の又は地理的な基本的要因、基本的な技術上の問題等の理由により、当該国際規格又はその関連部分が、追求される正当な目的を達成する方法として効果的でなく又は適当でない場合は、この限りでない。

産業標準化法

(日本産業規格の尊重)
第六十九条 国及び地方公共団体は、鉱工業に関する技術上の基準を定めるとき、その買い入れる鉱工業品に関する仕様を定めるときその他その事務を処理するに当たつて第二条第一項各号に掲げる事項に関し一定の基準を定めるときは、日本産業規格を尊重してこれをしなければならない。
(産業標準化及び国際標準化の促進)
第七十条 国は、産業標準の制定及び普及、国際標準に関する国際団体その他の国際的な枠組みへの協力並びに産業標準化及び国際標準化に関する業務に従事する者への支援を通じて、産業標準化及び国際標準化の促進に努めるものとする。
2 国立研究開発法人(独立行政法人通則法(平成十一年法律第百三号)第二条第三項に規定する国立研究開発法人をいう。第四項において同じ。)及び大学は、民間事業者と連携しつつ、産業標準化に資する研究開発、国際標準に関する国際団体その他の国際的な枠組みへの協力及びその他の産業標準化又は国際標準化に関する活動に主体的に取り組むよう努めるとともに、産業標準化又は国際標準化に関する業務に従事する者の職務がその重要性にふさわしい魅力あるものとなるよう、産業標準化又は国際標準化に関する業務に従事する者の適切な処遇の確保に努めるものとする。
3 事業者は、産業標準化に資する研究開発、国際標準に関する国際団体その他の国際的な枠組みへの協力及びその他の産業標準化又は国際標準化に関する活動に主体的に取り組むよう努めるとともに、産業標準化又は国際標準化に関する業務に従事する者の職務がその重要性にふさわしい魅力あるものとなるよう、産業標準化又は国際標準化に関する業務に従事する者の適切な処遇の確保に努めるものとする。

日本工業規格JIS Z8301:2008規格票の様式及び作成方法
http://kikakurui.com/z8/Z8301-2011-01.html

JIS等原案作成マニュアル - JISC 日本工業標準調査会
http://www.jisc.go.jp/jis-act/pdf/jis-manual.pdf

C言語

C言語は、CPUの発展のために規定しないことを高らかに歌っており、慣習が過去に対するものであるのに対して、未来に対して新たな技術の発展を阻害しないことを歌っている。

C - Project status and milestones
http://www.open-std.org/jtc1/sc22/wg14/www/projects

C言語規格を審議しているISO/IEC JTC1 SC22 WG14は、審議中の文書を公開している。

N2596(C2xの案)
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2596.pdf

私は、ISO/IEC JTC1 SC7からISO/IEC JTC1 SC22へのliaisonとして, IEEEのJim Moorと連絡担当をしていたことがある。

今は、MISRAがLiaisonとして毎回報告を出している。

hosted and freestanding

Conformance

4. Conformance

6 The two forms of conforming implementation are hosted and freestanding. A conforming hosted implementation shall accept any strictly conforming program. A conforming freestanding implemen- tation shall accept any strictly conforming program in which the use of the features specified in the library clause (Clause 7) is confined to the contents of the standard headers ,
, , , , , , , and . A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program.4)
7 The strictly conforming programs that shall be accepted by a conforming freestanding implementa- tion that defines STDC_IEC_60559_BFP or STDC_IEC_60559_DFP may also use features in the contents of the standard headers and and the numeric conversion functions (7.22.1) of the standard header . All identifiers that are reserved when is included in a hosted implementation are reserved when it is included in a freestanding implementa- tion.
8 A conforming program is one that is acceptable to a conforming implementation.5)
9 An implementation shall be accompanied by a document that defines all implementation-defined
and locale-specific characteristics and all extensions.

Environment

5.1.2 Execution environments
1 Two execution environments are defined: freestanding and hosted. In both cases, program startup occurs when a designated C function is called by the execution environment. All objects with static storage duration shall be initialized (set to their initial values) before program startup. The manner and timing of such initialization are otherwise unspecified. Program termination returns control to the execution environment.

Freestanding environment

5.1.2.1 Freestanding environment
1 In a freestanding environment (in which C program execution may take place without any ben- efit of an operating system), the name and type of the function called at program startup are implementation-defined. Any library facilities available to a freestanding program, other than the minimal set required by Clause 4, are implementation-defined.
2 The effect of program termination in a freestanding environment is implementation-defined.

Hosted environment

5.1.2.2 Hosted environment
1 A hosted environment need not be provided, but shall conform to the following specifications if present.

参照

MISRA C まとめ #include
https://qiita.com/kaizen_nagoya/items/f1a79a7cbd281607c7c9

MISRA-C 2012 Referenceに掲載している文献の入手可能性を確認
https://qiita.com/kaizen_nagoya/items/96dc8b125e462d5575bb

C Puzzle Bookの有り難み5つ、C言語規格及びCコンパイラの特性を認識
https://qiita.com/kaizen_nagoya/items/d89a48c1536a02ecdec9

[C][C++]の国際規格案の例題をコンパイルするときの課題7つ。
https://qiita.com/kaizen_nagoya/items/5f4b155030259497c4de

どうやって MISRA C Example Suiteをコンパイルするか
https://qiita.com/kaizen_nagoya/items/fbdbff5ff696e2ca7f00

C言語(C++)に対する誤解、曲解、無理解、爽快。
https://qiita.com/kaizen_nagoya/items/3f3992c9722c1cee2e3a

心理学の本を読むよりはコンパイラ書いた方がよくね。仮説(34)
https://qiita.com/kaizen_nagoya/items/fa715732cc148e48880e

コンパイラを書くのは難しいか。仮説(175)
https://qiita.com/kaizen_nagoya/items/a87c65d487bc7a67da11

C Puzzle Bookの有り難み5つ、C言語規格及びCコンパイラの特性を認識
https://qiita.com/kaizen_nagoya/items/d89a48c1536a02ecdec9

プログラミング言語教育のXYZ
https://qiita.com/kaizen_nagoya/items/1950c5810fb5c0b07be4

国際規格を読む前に
https://qiita.com/kaizen_nagoya/items/3917eb7b7c3a3a3cb4e0

国際規格のNormative Reference
https://qiita.com/kaizen_nagoya/items/b94b6055997119ac2d9a

プログラマが知っているとよいかもしれない法律1000を目標に収集中。
https://qiita.com/kaizen_nagoya/items/eeffde5e7ee049f0adeb

C言語:未定義、未規定、処理系定義
https://qiita.com/kaizen_nagoya/items/f416efd38aaaec7f8230

権利と義務の前に。仮説(147)
https://qiita.com/kaizen_nagoya/items/47d4e992d0fd340403fd

「本物のC」は「Cの精神」と 「freestanding と hosted」と「未定義、未規定、処理系定義」https://qiita.com/kaizen_nagoya/items/11d66a02479239bf80dd

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>

This article is an individual impression based on the individual's experience. It has nothing to do with the organization or business to which I currently belong.

文書履歴(document history)

ver. 0.01 初稿  20230729
ver. 0.02 URL追記 20240412

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2