MSVC build is broken (undeclared `DTLS_DEBUG_BUF_SIZE`)
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- c, cmake
- Bereich
- build-system
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- C
- Sterne
- 122
- Forks
- 67
- Ø Merge
- 6 T. 8 Std.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus eclipse-tinydtls/tinydtls
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
eclipse-tinydtls/tinydtls#274 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
DTLS 1.2 (RFC 6347) Compliance Observations in tinydtlsEvtl. wieder frei @boaks hat das vor 199 Tagen übernommen, und es ist kein Pull Request offen. Offenbug good first issue
eclipse-tinydtls/tinydtls#268 · 2 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
New tag / versionOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
eclipse-tinydtls/tinydtls#261 · 6 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
eclipse-tinydtls/tinydtls#258 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Server DoS vulnerability via malformed handshake sequenceEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
eclipse-tinydtls/tinydtls#244 · 9 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in eclipse-tinydtls/tinydtls
Ähnliche Issues
-
luaebpf: the by-example page's intro names two outcomes of a lowering and omits the stop with the default verdictEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offendocumentation severity: low
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
luainkernel/lunatik#2231 ·
Maintainer antworten meist innerhalb von 1 Tag
-
aspect ratio 16:10Offenenhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Revivedx/SavageWindRecomp#402 ·
Maintainer antworten meist innerhalb von 1 Tag
-
cleanup help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ESPresense/ESPresense#2602 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
apache/arrow-swift#209 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
libretiny-eu/libretiny#435 ·
Maintainer antworten meist innerhalb von 4 Tagen