Skip to content

MSVC warning about signed to unsigned conversion. #185

@MarekKnapek

Description

@MarekKnapek

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
>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions