Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

MSVC build is broken (undeclared `DTLS_DEBUG_BUF_SIZE`)

Open
#283 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@mrdeep1 is already working on this.

Since Oct 3, 2026.

  • #296 by @mrdeep1 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
c, cmake
Domain
build-system

Research direction

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.

Written by the indexing model from the issue text.

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

  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.

Dominant language
C
Stars
122
Forks
67
Avg merge
6d 8h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-tinydtls/tinydtls

All issues in eclipse-tinydtls/tinydtls

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.