Skip to content

Conversation

@MarekKnapek
Copy link
Contributor

Fix MSVC warnings described in #185.

Before:

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
>

After:

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
[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
>

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant