Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Improve C89/C90 compatibility by conditionally including <stdint.h>

オープン
#7 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

@KRASTM がすでに取り組んでいます。

2026年8月14日 から。

評価

この issue はまだ評価されていません。

説明

cmsis enhancement

https://github.com/STMicroelectronics/cmsis-core/blob/afc5ca6af0a49232fde7eb4548dd0962d119ce14/CMSIS/Core/Include/cmsis_compiler.h#L26

The current implementation unconditionally includes the standard header file <stdint.h>. While this is valid for C99 and later standards, some toolchains, such as IAR Embedded Workbench configured for C89/C90 compliance, may not provide this header, resulting in compilation errors.

To improve compatibility with older C language standards while preserving existing functionality, the inclusion of <stdint.h> should be conditioned on the detected language standard.

Current Code

#include <stdint.h>

Proposed Fix

#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
  /* C89/C90 mode: Define standard integer types locally */
#else
  /* C99 and later: Use standard stdint.h */
  #include <stdint.h>
#endif

Rationale

<stdint.h> is part of the C99 standard and is not guaranteed to be available when compiling in C89/C90 mode. The proposed change allows the code to compile in both C89/C90 and C99+ environments by only including <stdint.h> when the language standard supports it.

Expected Benefit

  • Improved compatibility with C89/C90 toolchains, including IAR Embedded Workbench.
  • No functional impact on existing C99 and newer builds.
  • Better portability across different compiler configurations.
主要言語
C
スター
84
フォーク
24
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。