MSVC warning about signed to unsigned conversion.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- build-system
Research direction
Start with nob.h lines 2090 and 2097, then reproduce the warnings using cl nob.c in how_to/010_nob_two_stage. Trace the reported signed-to-unsigned conversions and verify that the example builds with /W4 without C4244 warnings.
Written by the indexing model from the issue text.
Description
Warning 1:
.\nob.h(2090): warning C4244: '=': conversion from '__int64' to 'size_t', possible loss of data
Warning 2:
.\nob.h(2097): warning C4244: 'function': conversion from '__int64' to 'size_t', possible loss of data
Steps to reproduce:
c:\path\to\nob.h\how_to\010_nob_two_stage
>cl nob.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35721 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
nob.c
Microsoft (R) Incremental Linker Version 14.50.35721.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:nob.exe
nob.obj
c:\path\to\nob.h\how_to\010_nob_two_stage
>nob.exe
[INFO] created directory `build/`
[INFO] Generating initial build/config.h
[INFO] ==================================
[INFO] EDIT build/config.h TO CONFIGURE YOUR BUILD!!!
[INFO] ==================================
[INFO] CMD: cl.exe /W4 /nologo /D_CRT_SECURE_NO_WARNINGS -I. -Ibuild/ -Isrc_build/ /Fe:build/nob_configed /Fo:build/nob_configed src_build/nob_configed.c
nob_configed.c
.\nob.h(2090): warning C4244: '=': conversion from '__int64' to 'size_t', possible loss of data
.\nob.h(2097): warning C4244: 'function': conversion from '__int64' to 'size_t', possible loss of data
[INFO] CMD: build/nob_configed
[INFO] CMD: cl.exe /W4 /nologo /D_CRT_SECURE_NO_WARNINGS -Ibuild/ -I. /Fe:build/main /Fo:build/main src/main.c
main.c
c:\path\to\nob.h\how_to\010_nob_two_stage
>build\main.exe
Hello, World
c:\path\to\nob.h\how_to\010_nob_two_stage
>
- Dominant language
- C++
- Stars
- 3.3k
- Forks
- 215
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tsoding/nob.h
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
nob__walk_dir_opt_impl() tries to close zeroed handle for non directory entriesPossibly taken @whophi claimed this 62 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
nob_get_file_type error check is dead code: nob_copy_directory_recursively aborts and nob_walk_dir returns true on unreadable pathsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Similar issues
-
8-membered-ring atrop stereo lost in 2026.09.1Possibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 Half a day Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
thread safetyOpen1.0
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
libasr headers?Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Type: Bug :bug:
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
llvm-trunk
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day