Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Fix MSVC warnings.#186

Open
MarekKnapek wants to merge 1 commit intotsoding:main from
MarekKnapek:warnings
Open

Fix MSVC warnings. #186
MarekKnapek wants to merge 1 commit intotsoding:main from
MarekKnapek:warnings

Conversation

@MarekKnapek
Copy link
Contributor

@MarekKnapek MarekKnapek commented Jan 6, 2026

Fix MSVC warnings described in #185.

Before:

c:\path\to\nob.h\how_to010円_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_to010円_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_to010円_nob_two_stage
>build\main.exe
Hello, World
c:\path\to\nob.h\how_to010円_nob_two_stage
>

After:

c:\path\to\nob.h\how_to010円_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_to010円_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
[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_to010円_nob_two_stage
>build\main.exe
Hello, World
c:\path\to\nob.h\how_to010円_nob_two_stage
>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /