MSVC build is broken (undeclared `DTLS_DEBUG_BUF_SIZE`)
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- c, cmake
- Domaine
- build-system
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- C
- Étoiles
- 122
- Forks
- 67
- Merge moyen
- 6 j 8 h
- PR mergées (30 j)
- 6
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de eclipse-tinydtls/tinydtls
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
eclipse-tinydtls/tinydtls#274 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
DTLS 1.2 (RFC 6347) Compliance Observations in tinydtlsPeut-être à nouveau libre @boaks l’a pris il y a 195 jours, et aucune pull request n’est ouverte. Ouvertebug good first issue
eclipse-tinydtls/tinydtls#268 · 2 commentaires · 1 réaction · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
New tag / versionOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
eclipse-tinydtls/tinydtls#261 · 6 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
eclipse-tinydtls/tinydtls#258 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Server DoS vulnerability via malformed handshake sequencePeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertebug
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
eclipse-tinydtls/tinydtls#244 · 9 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de eclipse-tinydtls/tinydtls
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
libsdl-org/SDL#16607 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
PowerShell/Win32-OpenSSH#2482 · 1 réaction ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
zephyrproject-rtos/zephyr#123881 ·
Les mainteneurs répondent en général sous 2 jours