Building with Visual Studio: Every variable is a const lvalue

Installing on windows
Post Reply
User avatar
empathicqubit
New member
Posts: 4
Joined: Fri Jan 13, 2023 6:01 pm

Building with Visual Studio: Every variable is a const lvalue

Post by empathicqubit »

I'm trying to compile the compiler, and when I try to use it with PATH and ZCCCFG set, I get these errors:

z:\UserProfiles\EmpathicQubit\tyzzy\tests\./main.c:36:50: error: Attempt to modify const lvalue 'i'

This happens even with v2.2 checked out. It does compile with the released version.
User avatar
empathicqubit
New member
Posts: 4
Joined: Fri Jan 13, 2023 6:01 pm

Re: Building with Visual Studio: Every variable is a const lvalue

Post by empathicqubit »

I'm looking at the isconst value in the debugger, and it's set to -51, which seems wrong
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Building with Visual Studio: Every variable is a const lvalue

Post by dom »

That is wrong! It should either be 0 or 1. The code uses calloc() to allocate the Type so it should be 0 by default. Do the rest of the members within the struct look sensible?

For release we compile with mingw not visual studio.
User avatar
empathicqubit
New member
Posts: 4
Joined: Fri Jan 13, 2023 6:01 pm

Re: Building with Visual Studio: Every variable is a const lvalue

Post by empathicqubit »

Not really. There are a few others which are also -51. I'll try to trace it down.
User avatar
empathicqubit
New member
Posts: 4
Joined: Fri Jan 13, 2023 6:01 pm

Re: Building with Visual Studio: Every variable is a const lvalue

Post by empathicqubit »

Post Reply