MSVC build is broken (undeclared `DTLS_DEBUG_BUF_SIZE`)
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 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
-
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 -
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-tinydtls/tinydtls のほかの issue
-
ECDHE_ECDSA ClientKeyExchange rejected as too short when DTLS_PSK_MAX_CLIENT_IDENTITY_LEN > 64対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug good first issue please retest
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
eclipse-tinydtls/tinydtls#298 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
`dtls_get_cookie`: dereference before the length check (currently masked by `dtls_create_cookie`)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
eclipse-tinydtls/tinydtls#279 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 57/100
eclipse-tinydtls/tinydtls#278 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
eclipse-tinydtls/tinydtls#274 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
eclipse-tinydtls/tinydtls#273 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
eclipse-tinydtls/tinydtls の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
semantic-reasoning/wirelog#2163 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
Xinyuan-LilyGO/T-Display-S3#352 · コメント 3 件 ·
-
documentation severity/minor
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
shenmintao/aic8800d80#107 · コメント 1 件 ·