MISRA C:2012 Example-Suite https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite
La route vers l'achèvement de la compilation
Exécutez [user] avec le nom de dossier réel avec la commande docker ci-dessous. Tout d'abord, j'ai présenté la version régulière de GCC en envisageant de compiler avec GCC.
macOS
$ docker run -v /Users/[user]/Downloads/misra:/tmp/misra -it gcc /bin/bash
Je partage le dossier car je le modifie à l'aide de l'éditeur côté PC.
# cd /tmp/misra
# git clone https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite.git
# cd Example-Suite/
Vous pouvez faire un autre travail en l'introduisant, mais vous pourrez le faire plus tard.
docker
# apt update; apt -y upgrade
# apt install -y vim wget sudo apt-utils curl clang
Liste des noms de fichiers
D_01_01.c D_01_support.c D_01_system.c D_02_01.c D_02_support.c D_02_system.c D_03_01.c D_03_support.c D_03_system.c D_04_01.c D_04_01.h D_04_02.c D_04_03.c D_04_04.c D_04_05.c D_04_06.c D_04_07.c D_04_08.h D_04_08_1.c D_04_08_2.c D_04_09.c D_04_10.c D_04_10_1.h D_04_10_2.h D_04_10_3.h D_04_11.c D_04_12.c D_04_13.c D_04_13.h D_04_14.c D_04_support.c D_04_system.c README.md R_01_01.c R_01_02.c R_01_03.c R_01_support.c R_01_system.c R_02_01.h R_02_01_1.c R_02_01_2.c R_02_02.c R_02_02.h R_02_03.c R_02_03.h R_02_04.c R_02_04.h R_02_05.c R_02_05.h R_02_06.c R_02_07.c R_02_support.c R_02_system.c R_03_01.c R_03_02.c R_03_support.c R_03_system.c R_04_01.c R_04_02.c R_04_support.c R_04_system.c R_05_01.h R_05_01_1.c R_05_01_2.c R_05_02.c R_05_03.c R_05_03.h R_05_04.c R_05_05.c R_05_06.c R_05_06.h R_05_07.c R_05_07.h R_05_08.h R_05_08_1.c R_05_08_2.c R_05_09.h R_05_09_1.c R_05_09_2.c R_05_support.c R_05_system.c R_06_01.c R_06_02.c R_06_support.c R_06_system.c R_07_01.c R_07_02.c R_07_03.c R_07_04.c R_07_04.h R_07_support.c R_07_system.c R_08_01.c R_08_02.c R_08_03.c R_08_03.h R_08_04.c R_08_04.h R_08_05.h R_08_05_1.c R_08_05_2.c R_08_06.h R_08_06_1.c R_08_06_2.c R_08_07.h R_08_07_1.c R_08_07_2.c R_08_08.c R_08_09.c R_08_09.h R_08_10.c R_08_11.h R_08_11_1.c R_08_11_2.c R_08_12.c R_08_13.h R_08_13_1.c R_08_13_2.c R_08_14.c R_08_support.c R_08_system.c R_09_01.c R_09_01.h R_09_02.c R_09_03.c R_09_04.c R_09_05.c R_09_support.c R_09_system.c R_10_01.c R_10_02.c R_10_03.c R_10_04.c R_10_04.h R_10_05.c R_10_06.c R_10_07.c R_10_08.c R_10_support.c R_10_system.c R_11_01.c R_11_02.c R_11_03.c R_11_04.c R_11_05.c R_11_06.c R_11_07.c R_11_08.c R_11_09.c R_11_support.c R_11_system.c R_12_01.c R_12_01.h R_12_02.c R_12_02.h R_12_03.c R_12_04.c R_12_05.c R_12_support.c R_12_system.c R_13_01.h R_13_01_1.c R_13_01_2.c R_13_02.c R_13_02.h R_13_03.c R_13_04.c R_13_05.h R_13_05_1.c R_13_05_2.c R_13_06.c R_13_support.c R_13_system.c R_14_01.c R_14_01.h R_14_02.c R_14_02.h R_14_03.c R_14_03.h R_14_04.c R_14_support.c R_14_system.c R_15_01.c R_15_02.c R_15_03.c R_15_04.c R_15_04.h R_15_05.c R_15_06.c R_15_06.h R_15_07.c R_15_07.h R_15_support.c R_15_system.c R_16_01.c R_16_02.c R_16_03.c R_16_04.c R_16_05.c R_16_06.c R_16_07.c R_16_support.c R_16_system.c R_17_01.c R_17_02.c R_17_02.h R_17_03.c R_17_04.c R_17_05.c R_17_05.h R_17_06.c R_17_07.c R_17_08.c R_17_08.h R_17_support.c R_17_system.c R_18_01.c R_18_01.h R_18_02.c R_18_02.h R_18_03.c R_18_03.h R_18_04.c R_18_05.c R_18_06.h R_18_06_1.c R_18_06_2.c R_18_07.c R_18_08.c R_18_support.c R_18_system.c R_19_01.c R_19_01.h R_19_02.c R_19_support.c R_19_system.c R_20_01.c R_20_01.h R_20_02.c R_20_03.c R_20_03.h R_20_04.c R_20_05.c R_20_06.c R_20_07.c R_20_08.c R_20_09.c R_20_10.c R_20_11.c R_20_12.c R_20_13.c R_20_14.c R_20_14_1.h R_20_14_2.h R_20_support.c R_20_system.c R_21_01.c R_21_02.c R_21_03.c R_21_04.c R_21_05.c R_21_06.c R_21_07.c R_21_08.c R_21_09.c R_21_10.c R_21_11.c R_21_12.c R_21_13.c R_21_14.c R_21_14.h R_21_15.c R_21_16.c R_21_17.c R_21_18.c R_21_19.c R_21_20.c R_21_support.c R_21_system.c R_22_01.c R_22_01.h R_22_02.c R_22_02.h R_22_03.c R_22_03.h R_22_04.c R_22_04.h R_22_05.c R_22_05.h R_22_06.c R_22_06.h R_22_07.c R_22_08.c R_22_09.c R_22_10.c R_22_support.c R_22_system.c mc3_header.h mc3_types.h
cat D_01_system.c /*
include "mc3_types.h" include "mc3_header.h"
int main ( void ) { D_1_main_support ( ); return 0; }
/* end of D_01_system.c */
xx_system.Tout ce que vous avez à faire est de compiler et d'exécuter c.
# 5.création de script shell
Vous pouvez utiliser make, mais pour le moment, utilisez shell.
# 6. misra_c.h modifier
Jusqu'à présent, fragments de code MISRA, C, C++Modifiez le fichier d'en-tête utilisé pour compiler le fragment de code du standard de langage de.
Résumé MISRA C#include <misra_c.h>
https://qiita.com/kaizen_nagoya/items/f1a79a7cbd281607c7c9
#Le progrès
J'expliquerai les sources corrigées créées par MISRA une par une séparément.
docker(201) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(1) D_04_03.c
https://qiita.com/kaizen_nagoya/items/780be9109348340e20e0
docker(202) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(2) R_02_02.c
https://qiita.com/kaizen_nagoya/items/496869b87dd3d29cea8b
docker(203) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(3) R_05_03.c
https://qiita.com/kaizen_nagoya/items/cb0d1da183f4f1e9e59d
docker(204) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(4) R_07_04.c
https://qiita.com/kaizen_nagoya/items/73b9f16638273a74d807
docker(205) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(5) R_08_04.c
https://qiita.com/kaizen_nagoya/items/c753db14cc95a9303fa5
docker(206) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(6) R_09_0x.c
https://qiita.com/kaizen_nagoya/items/8ad38c8728440688255c
docker(207) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(7) R_10_0x.c
https://qiita.com/kaizen_nagoya/items/05dd6f6c14aeafbe3e71
docker(208) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(8) R_11_0x.c
https://qiita.com/kaizen_nagoya/items/9962647a1b510825fa6e
docker(209) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(9) R_13_0x.c
https://qiita.com/kaizen_nagoya/items/dcd2de1267e3c3449536
docker(210) gcc(gnu), clang(llvm)Compiler la comparaison des erreurs / avertissements(10) R_14_0x.c
https://qiita.com/kaizen_nagoya/items/772f49486e7cca1dbeb9
#La fin de la route
Résultats du travail sur Docker Hub
#### **`macOS`**
```shell-session
$ docker push kaizenjapan/misra_c_2012_example
#Le lendemain du dernier jour du voyage
Pour continuer le lendemain
$ docker run -v /Users/[user]/Downloads/misra:/tmp/misra -it kaizenjapan/misra_c_2012_example /bin/bash
Résumé MISRA C#include <misra_c.h> https://qiita.com/kaizen_nagoya/items/f1a79a7cbd281607c7c9
#Environnement
docker gcc(g++) and llvm(clang++) https://qiita.com/kaizen_nagoya/items/059874ea39c4de64c0f7
docker(40)3 types de compilateur C avec docker(Partie 2) https://qiita.com/kaizen_nagoya/items/8f5b7fd977597269a7e7
February 2020, MISRA Compliance:2020 https://www.misra.org.uk/forum/viewtopic.php?f=241&t=1842 ISBN 978-1-906400-26-2
was published as second version.
August 2016, MISRA Compliance:2016 https://www.misra.org.uk/forum/viewtopic.php?f=241&t=1561 was published first version.
I compare 2 documents and consider the difference. And some propose are proposed.
Preface Contents Before MISRA MISRA history Comparison of MISRA Compliance:2016 and 2020
#MISRA history
| word | mot | count |
|---|---|---|
| the | Cette | 842 |
| of | de | 433 |
| to | À | 376 |
| a | a | 369 |
| be | Devenir | 265 |
| and | Et | 223 |
| is | est | 222 |
| in | À | 209 |
| code | Millionnaire | 163 |
| for | pour | 135 |
| that | Il | 133 |
| guidelines | Des lignes directrices | 115 |
| are | Est | 114 |
| as | Alors | 108 |
| it | Il | 99 |
| by | Le long de | 97 |
| misra | MISRA | 96 |
| with | Quand | 95 |
| compliance | Conformité | 91 |
| may | Peut | 88 |
| guideline | Des lignes directrices | 87 |
| which | laquelle | 80 |
| or | Ou | 79 |
| this | cette | 75 |
| not | Absent | 74 |
| deviation | déviation | 71 |
| an | de | 63 |
| tool | outil | 59 |
| process | Procéder | 58 |
| project | Entreprise | 58 |
| analysis | une analyse | 56 |
| required | Obligatoire | 53 |
| adopted | Recrutement | 52 |
| compiler | compilateur | 52 |
| will | volonté | 51 |
| any | Tout | 48 |
| been | Est | 48 |
| on | au dessus de | 47 |
| rule | Règles | 47 |
| have | Avoir | 44 |
| use | utilisation | 42 |
| can | ça peut | 41 |
| development | développement de | 41 |
| there | Là | 40 |
| within | dans | 40 |
| software | Logiciel | 39 |
| violations | violation | 39 |
| when | Quand | 38 |
| deviations | déviation | 37 |
| should | devrait | 37 |
| c | c | 36 |
| has | avoir | 36 |
| possible | Possible | 36 |
| tools | outil | 36 |
| time | temps | 35 |
| example | Exemple | 34 |
| if | si | 34 |
| language | Langue | 34 |
| used | d'occasion | 34 |
| re | Ré | 31 |
| requirements | Exigences | 30 |
| acquirer | Acquéreur | 29 |
| these | celles-ci | 29 |
| some | Quelques | 27 |
| static | statique | 27 |
| such | comme ça | 27 |
| supplier | Fournisseur | 27 |
| compliant | Conforme | 26 |
| from | De | 26 |
| advisory | Conseil | 25 |
| but | Mais | 25 |
| quality | qualité | 25 |
| violation | violation | 25 |
| mandatory | Obligatoire | 23 |
| must | Doit | 23 |
| standard | la norme | 23 |
| at | alors | 22 |
| source | la source | 22 |
| system | système | 22 |
| all | tout | 21 |
| document | Document | 20 |
| following | Moins que | 20 |
| iso | iso | 19 |
| only | seulement | 19 |
| order | commande | 19 |
| other | Autre | 19 |
| shall | Faire | 19 |
| behaviour | mouvement | 18 |
| categorized | Classifié | 18 |
| category | Classification | 18 |
| developed | Développé | 18 |
| each | chaque | 18 |
| grp | grp | 18 |
| level | niveau | 18 |
| library | bibliothèque | 18 |
| no | nombre | 18 |
| section | section | 18 |
| where | Où | 18 |
| being | Être | 17 |
| native | Inné | 17 |
| need | nécessaire | 17 |
| organization | Organisation | 17 |
| record | Record | 17 |
| scope | intervalle | 17 |
| also | Aussi | 16 |
| between | Entre | 16 |
| defined | Défini | 16 |
| permits | Autorisation | 16 |
| plan | des plans | 16 |
| their | leur | 16 |
| they | ils | 16 |
| type | Moule | 16 |
| would | ça ira | 16 |
| applied | Appliqué | 15 |
| b | b | 15 |
| different | Faux | 15 |
| does | Faire | 15 |
| iec | iec | 15 |
| issues | problème | 15 |
| metrics | Norme de mesure | 15 |
| permit | Autorisation | 15 |
| rules | Règles | 15 |
| safety | sécurité | 15 |
| therefore | Donc | 15 |
| both | tous les deux | 14 |
| case | Si | 14 |
| enforcement | Exécution | 14 |
| ensure | Sécurise | 14 |
| many | beaucoup | 14 |
| more | Plus | 14 |
| permitted | Permis | 14 |
| s | s | 14 |
| systems | système | 14 |
| validation | Vérification | 14 |
| comply | Suivre | 13 |
| disapplied | Désappointé | 13 |
| however | pourtant | 13 |
| implementation | la mise en oeuvre | 13 |
| means | veux dire | 13 |
| one | 1 | 13 |
| same | le même | 13 |
| appendix | appendice | 12 |
| bit | Nombre binaire | 12 |
| categorization | Classification | 12 |
| during | à l'intérieur | 12 |
| header | entête | 12 |
| necessary | nécessaire | 12 |
| object | Cible | 12 |
| style | forme | 12 |
| approved | approuvé | 11 |
| cannot | Ne peux pas | 11 |
| cases | Incident | 11 |
| coding | codage | 11 |
| configured | Préconfiguré | 11 |
| described | expliqué | 11 |
| documentation | Documentation | 11 |
| expression | Expression faciale | 11 |
| files | Fichier | 11 |
| identified | Identifié | 11 |
| information | information | 11 |
| its | Cette | 11 |
| made | Fait | 11 |
| provide | fournir | 11 |
| provided | Offre | 11 |
| review | La revue | 11 |
| security | le soulagement | 11 |
| staff | Facteur | 11 |
| those | Ceux | 11 |
| translation | Traduction | 11 |
| appropriate | Approprié | 10 |
| available | Disponible | 10 |
| developer | Développeur | 10 |
| essential | Obligatoire | 10 |
| even | même | 10 |
| file | Fichier | 10 |
| important | important | 10 |
| make | créer | 10 |
| messages | message | 10 |
| multiplication | Multiplier | 10 |
| non | Non | 10 |
| note | Mise en garde | 10 |
| operands | Enfant affecté | 10 |
| processes | processus | 10 |
| reason | Raison | 10 |
| records | Record | 10 |
| result | résultat | 10 |
| reviewed | Examen | 10 |
| then | ensuite | 10 |
| undecidable | Je ne peux pas décider | 10 |
| using | en utilisant | 10 |
| version | Édition | 10 |
| wider | large | 10 |
| without | Aucun | 10 |
| additional | ajouter à | 9 |
| apply | Appliquer | 9 |
| checking | Confirmer | 9 |
| control | contrôle | 9 |
| functional | fonctionnel | 9 |
| gcs | gcs | 9 |
| how | Comment | 9 |
| international | international | 9 |
| macro | grand | 9 |
| management | la gestion | 9 |
| produced | Produit | 9 |
| product | Produit | 9 |
| programming | la programmation | 9 |
| run | Courir | 9 |
| violated | Violé | 9 |
| analyser | Analyste | 8 |
| associated | Relation | 8 |
| checked | Inspecté | 8 |
| checks | Inspection | 8 |
| claim | Prétendre | 8 |
| compilers | compilateur | 8 |
| composite | composite | 8 |
| do | Faire | 8 |
| e | e | 8 |
| every | chaque | 8 |
| form | forme | 8 |
| given | donné | 8 |
| introduced | introduction | 8 |
| message | message | 8 |
| might | Peut | 8 |
| number | nombre | 8 |
| part | département | 8 |
| practice | entraine toi | 8 |
| produce | produire | 8 |
| provides | fournir | 8 |
| set | Ensemble | 8 |
| single | Célibataire | 8 |
| standardization | Standardisation | 8 |
| standards | la norme | 8 |
| step | un pas | 8 |
| summary | Aperçu | 8 |
| supported | Prise en charge | 8 |
| two | deux | 8 |
| value | valeur | 8 |
| various | divers | 8 |
| versions | Édition | 8 |
| activities | Activités | 7 |
| agreement | Accord | 7 |
| binary | Binaire | 7 |
| check | vérifier | 7 |
| correct | correct | 7 |
| could | peut être......droite | 7 |
| define | Définir | 7 |
| dir | dir | 7 |
| documents | Des documents | 7 |
| execution | Courir | 7 |
| extensions | Expansion | 7 |
| function | une fonction | 7 |
| include | Comprenant | 7 |
| into | À | 7 |
| ltd | Co., Ltd. | 7 |
| most | plus | 7 |
| nature | La nature | 7 |
| options | Les choix | 7 |
| performance | Performance | 7 |
| program | programme | 7 |
| providing | Offre | 7 |
| related | Relation | 7 |
| report | rapport | 7 |
| require | j'ai besoin de | 7 |
| risk | Danger | 7 |
| see | à voir | 7 |
| significant | important | 7 |
| situations | Statut | 7 |
| size | Taille | 7 |
| so | alors | 7 |
| specified | Spécifié | 7 |
| support | soutien | 7 |
| task | travaux | 7 |
| testing | tester | 7 |
| training | Entraînement | 7 |
| uint | uint | 7 |
| well | Bien | 7 |
| whether | qu'il s'agisse | 7 |
| written | Enregistré | 7 |
| approach | manière | 6 |
| because | Parce que | 6 |
| capable | Talentueux | 6 |
| circumstances | Statut | 6 |
| claimed | Insisté | 6 |
| classification | Classification | 6 |
| clearly | Clairement | 6 |
| consider | considérer | 6 |
| design | conception | 6 |
| diagnosis | Diagnostic | 6 |
| directive | Commander | 6 |
| effort | effort | 6 |
| errors | S'excuser | 6 |
| exactly | exactement | 6 |
| examples | Exemple | 6 |
| f | f | 6 |
| guide | orientation | 6 |
| horiba | Horiba | 6 |
| implement | Mettre en place | 6 |
| included | Comprenant | 6 |
| likely | peut être | 6 |
| limited | Limité | 6 |
| list | liste | 6 |
| mira | MIRA | 6 |
| outside | à l'extérieur | 6 |
| over | c'est tout | 6 |
| particular | En particulier | 6 |
| performed | Réalisé | 6 |
| phase | étape | 6 |
| place | endroit | 6 |
| references | référence | 6 |
| simply | simplement | 6 |
| since | Depuis | 6 |
| sometimes | quelquefois | 6 |
| specific | précis | 6 |
| t | t | 6 |
| taken | Pris | 6 |
| than | Que | 6 |
| types | Moule | 6 |
| understanding | Compréhension | 6 |
| unit | unité | 6 |
| FALSE | faux | 6 |
Recommended Posts