Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible redefinition of 'size_t' #21477

Open
RednibCoding opened this issue May 8, 2024 · 0 comments
Open

incompatible redefinition of 'size_t' #21477

RednibCoding opened this issue May 8, 2024 · 0 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@RednibCoding
Copy link

RednibCoding commented May 8, 2024

Describe the bug

I have this code:

// main.v
fn main() {
    areas := ['game', 'web', 'tools', 'science', 'systems',
              'embedded', 'drivers', 'GUI', 'mobile']
    for area in areas {
        println('Hello, ${area} developers!')
    }
}

And want to compile it on windows 11 with: v main.v -freestanding

Then i get the following error:

==================
C:/Users/user/AppData/Local/Temp/v_0/main.01HXD2AJXNBAZTECS0SAW0QYZD.tmp.c:450: error: incompatible redefinition of 'size_t'
...
==================
(Use `v -cg` to print the entire error message)

builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .

Reproduction Steps

Try to comile the following code:

// main.v
fn main() {
    areas := ['game', 'web', 'tools', 'science', 'systems',
              'embedded', 'drivers', 'GUI', 'mobile']
    for area in areas {
        println('Hello, ${area} developers!')
    }
}

as follows: v main.v -freestanding

Expected Behavior

Should produce a binary

Current Behavior

Errors out

Possible Solution

No response

Additional Information/Context

When i use the flag -prod together with -freestanding i get a different error:

error: msvc compiler does not support inline assembly
  332 | fn sys_call0(scn u64) u64 {
  333 |     mut res := u64(0)
  334 |     asm amd64 {
      |     ~~~~~~~~~~~
  335 |         syscall
  336 |         ; =a (res)
C:/Users/user/Documents/DEV/DEPS/v/vlib/builtin/linux_bare/linux_syscalls.v:344:2: error: msvc compiler does not support inline assembly
  342 | fn sys_call1(scn u64, arg1 u64) u64 {
  343 |     mut res := u64(0)
  344 |     asm amd64 {
      |     ~~~~~~~~~~~
  345 |         syscall
  346 |         ; =a (res)
C:/Users/user/Documents/DEV/DEPS/v/vlib/builtin/linux_bare/linux_syscalls.v:355:2: error: msvc compiler does not support inline assembly
  353 | fn sys_call2(scn u64, arg1 u64, arg2 u64) u64 {
  354 |     mut res := u64(0)
  355 |     asm amd64 {
      |     ~~~~~~~~~~~
  356 |         syscall
  357 |         ; =a (res)
C:/Users/user/Documents/DEV/DEPS/v/vlib/builtin/linux_bare/linux_syscalls.v:367:2: error: msvc compiler does not support inline assembly
  365 | fn sys_call3(scn u64, arg1 u64, arg2 u64, arg3 u64) u64 {
  366 |     mut res := u64(0)
  367 |     asm amd64 {
      |     ~~~~~~~~~~~
  368 |         syscall
  369 |         ; =a (res)
C:/Users/user/Documents/DEV/DEPS/v/vlib/builtin/linux_bare/linux_syscalls.v:380:2: error: msvc compiler does not support inline assembly
  378 | fn sys_call4(scn u64, arg1 u64, arg2 u64, arg3 u64, arg4 u64) u64 {
  379 |     mut res := u64(0)
  380 |     asm amd64 {
      |     ~~~~~~~~~~~
  381 |         mov r10, arg4
  382 |         syscall
C:/Users/user/Documents/DEV/DEPS/v/vlib/builtin/linux_bare/linux_syscalls.v:396:2: error: msvc compiler does not support inline assembly
  394 | fn sys_call5(scn u64, arg1 u64, arg2 u64, arg3 u64, arg4 u64, arg5 u64) u64 {
  395 |     mut res := u64(0)
  396 |     asm amd64 {
      |     ~~~~~~~~~~~
  397 |         mov r10, arg4
  398 |         mov r8, arg5
C:/Users/user/Documents/DEV/DEPS/v/vlib/builtin/linux_bare/linux_syscalls.v:415:2: error: msvc compiler does not support inline assembly
  413 | fn sys_call6(scn u64, arg1 u64, arg2 u64, arg3 u64, arg4 u64, arg5 i64, arg6 u64) u64 {
  414 |     mut res := u64(0)
  415 |     asm amd64 {
      |     ~~~~~~~~~~~
  416 |         mov r10, arg4
  417 |         mov r8, arg5
C:/Users/user/Documents/DEV/DEPS/v/vlib/builtin/linux_bare/linux_syscalls.v:435:1: error: msvc compiler does not support inline assembly
  433 | }
  434 |
  435 | asm amd64 {
      | ~~~~~~~~~~~
  436 |     .globl _start
  437 |     _start:

V version

V 0.4.5 d6d0f9b

Environment details (OS name and version, etc.)

Betriebsystemname Microsoft Windows 11 Enterprise
Version 10.0.22621 Build 22621
Systemmodell Surface Pro 10 for Business
Systemtyp x64-basierter PC
Prozessor Intel(R) Core(TM) Ultra 7 165U, 2100 MHz, 12 Kern(e), 14 logische(r) Prozessor(en)
Installierter physischer Speicher (RAM) 32,0 GB

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@RednibCoding RednibCoding added the Bug This tag is applied to issues which reports bugs. label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant