Skip to content
New issue

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

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

Already on GitHub? # to your account

Running method with concurrency gives c error: pointer expected #23798

Closed
daansystems opened this issue Feb 23, 2025 · 2 comments · Fixed by #23800
Closed

Running method with concurrency gives c error: pointer expected #23798

daansystems opened this issue Feb 23, 2025 · 2 comments · Fixed by #23800
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.

Comments

@daansystems
Copy link

daansystems commented Feb 23, 2025

V version: V 0.4.9 3c88926, press to see full `v doctor` output
V full version V 0.4.9 5c65e58.3c88926
OS windows, Microsoft Windows 11 Pro 26100 64-bit
Processor 24 cpus, 64bit, little endian, AMD Ryzen 9 3900X 12-Core Processor
Memory 16.1GB/31.9GB
V executable C:\v\v.exe
V last modified time 2025-02-23 15:50:09
V home dir OK, value: C:\v
VMODULES OK, value: C:\Users\info.vmodules
VTMP OK, value: C:\Users\info\AppData\Local\Temp\v_0
Current working dir OK, value: D:\vbug2
Git version git version 2.42.0.windows.2
V git status weekly.2025.08-30-g3c88926f-dirty
.git/config present true
cc version N/A
gcc version N/A
clang version clang version 17.0.1
msvc version N/A
tcc version tcc version 0.9.27 (x86_64 Windows)
tcc git status thirdparty-windows-amd64 b425ac82
emcc version N/A
glibc version ldd (cygwin) 3.4.7

What did you do?
./v -g -o vdbg cmd/v && ./vdbg main.v && D:\vbug2\main.exe

module main



@[heap]
interface IGameObject {
mut:
	name     string
	parent   ?&IGameObject
	children []&IGameObject
	advance()
}

@[heap]
struct GameObject implements IGameObject {
mut:
	name     string
	parent   ?&IGameObject
	children []&IGameObject
}

struct Ship implements IGameObject {
	GameObject
	speed f32
}

fn (mut gameobject GameObject) advance() {
	for mut child in gameobject.children {
		go child.advance()
	}
}

fn main() {
	mut ship := &Ship{
		name: 'ship'
	}
	ship.advance()
}

What did you see?

================== C compilation error (from tcc): ==============
cc: C:/Users/info/AppData/Local/Temp/v_0/main.01JMSVTNC5B0THKVJY24F34MMC.tmp.c:532: warning: WINVER redefined
cc: C:/Users/info/AppData/Local/Temp/v_0/main.01JMSVTNC5B0THKVJY24F34MMC.tmp.c:2054: error: pointer expected
=================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
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 .

What did you expect to see?

no c error

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.

Copy link

Connected to Huly®: V_0.6-22208

@JalonSolov
Copy link
Contributor

Fails the same for me on Linux (except I don't see the line about WINVER), same version of V. Adding -g doesn't help.

@JalonSolov JalonSolov added Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. labels Feb 23, 2025
@felipensp felipensp added the Unit: cgen Bugs/feature requests, that are related to the default C generating backend. label Feb 23, 2025
@felipensp felipensp self-assigned this Feb 23, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants