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

MSVC build is broken (undeclared `DTLS_DEBUG_BUF_SIZE`)

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

メンテナーはふだん 2 日以内に返信

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

2026年10月3日 から。

  • #296 @mrdeep1 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
c, cmake
領域
build-system

調査の方向性

Start with dtls_debug.c, comparing the preprocessor condition around the DTLS_DEBUG_BUF_SIZE declaration (around lines 250–279) with its use around lines 397–403. Reproduce with the CMake configure and build commands on Windows with MSVC; the issue is done when that build succeeds. Pull request #296 is already open for this issue.

索引モデルが issue の本文から書いたものです。

説明

The MSVC-Build is currently (develop: https://github.com/eclipse-tinydtls/tinydtls/commit/d9738c31c374d879140f408ac81f2752eacaed4d) broken. It looks like a 4-year-old regression (see below).

Observation

Building with basic cmake commands under Win11 with VS2026:

$ rm -rf build/; cmake -B build && cmake --build build
-- Building for: Visual Studio 18 2026
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.51.36256.0
-- The CXX compiler identification is MSVC 19.51.36256.0
[...]
D:\github\eclipse-tinydtls\tinydtls\dtls_debug.c(402,16): error C2065: 'DTLS_DEBUG_BUF_SIZE': undeclared identifier [D:\github\eclipse-tinydtls\tinydtls\build\tinydtls.vcxproj]
D:\github\eclipse-tinydtls\tinydtls\dtls_debug.c(402,16): error C2057: expected constant expression [D:\github\eclipse-tinydtls\tinydtls\build\tinydtls.vcxproj]
D:\github\eclipse-tinydtls\tinydtls\dtls_debug.c(402,16): error C2466: cannot allocate an array of constant size 0 [D:\github\eclipse-tinydtls\tinydtls\build\tinydtls.vcxproj]
D:\github\eclipse-tinydtls\tinydtls\dtls_debug.c(402,8): error C2133: 'message': unknown size [D:\github\eclipse-tinydtls\tinydtls\build\tinydtls.vcxproj]

Build fails because of error C2065: 'DTLS_DEBUG_BUF_SIZE': undeclared identifier.

Analysis

The indentifier DTLS_DEBUG_BUF_SIZE is undeclared in this constellation because

  1. It gets declared inside a preprocessor condition #if !defined(WITH_CONTIKI) && !defined(_MSC_VER):
    https://github.com/eclipse-tinydtls/tinydtls/blob/d9738c31c374d879140f408ac81f2752eacaed4d/dtls_debug.c#L250-L279

  2. It gets used inside a different preprocessor condition #ifndef WITH_CONTIKI
    https://github.com/eclipse-tinydtls/tinydtls/blob/d9738c31c374d879140f408ac81f2752eacaed4d/dtls_debug.c#L397-L403

This means that the identifier is undeclared when building without contiki with the MSVC compiler.

It has probably been this way since the introduction of DTLS_DEBUG_BUF_SIZE in 2022: https://github.com/eclipse-tinydtls/tinydtls/commit/70a2b397af0b69488380689087fbc0562cebd497 (unconfirmed).

Conclusion

I'm not sure what the correct fix would be, but changing the latter condition to equal the former at least builds without errors again.

主要言語
C
スター
122
フォーク
67
平均マージ
6日 8時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

eclipse-tinydtls/tinydtls のほかの issue

eclipse-tinydtls/tinydtls の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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