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

Builder error #17431

Closed
Eliyaan opened this issue Feb 27, 2023 · 1 comment · Fixed by #21145
Closed

Builder error #17431

Eliyaan opened this issue Feb 27, 2023 · 1 comment · Fixed by #21145
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.

Comments

@Eliyaan
Copy link
Contributor

Eliyaan commented Feb 27, 2023

Describe the bug

Builder error :
warning: cast between pointer and integer of different size
error: pointer expected

Expected Behavior

This is the SSCCE that I made to reproduce the builder error (it's not part of my code I discovered it by mistake)

Current Behavior

PS C:\Users\PACHECON\_cv> v run "c:\Users\PACHECON\_cv\test_file.v"
==================
C:/Users/PACHECON/AppData/Local/Temp/v_0/test_file.597314614221110120.tmp.c:7599: warning: cast between pointer and integer of different size
C:/Users/PACHECON/AppData/Local/Temp/v_0/test_file.597314614221110120.tmp.c:12461: error: pointer expected
==================
(Use `v -cg` to print the entire error message)

builder error: 
==================
C error. This should never happen.

Reproduction Steps

[heap]
struct Particle{
}


[heap]
struct App {
mut:
	list_opti [][]&Particle
}

fn (mut app App) init_opti_list(){
	for mut liste in app.list_opti{
		if liste != []{
			liste.clear()
		}
		
	}
}


fn main() {
    mut app := &App{
        list_opti: [][]&Particle{len:10, init:[]&Particle{}}
    }
	app.init_opti_list()
}

Possible Solution

No response

Additional Information/Context

No response

V version

Current V version: V 0.3.3 864e199, timestamp: 2023-02-27 21:48:05 +0200

Environment details (OS name and version, etc.)

OS: windows, Microsoft Windows 10 Education v19045 64 bits

@Eliyaan Eliyaan added the Bug This tag is applied to issues which reports bugs. label Feb 27, 2023
@niuggg
Copy link

niuggg commented Mar 3, 2023

good thankyou

@felipensp felipensp added the Unit: cgen Bugs/feature requests, that are related to the default C generating backend. label Mar 16, 2023
@felipensp felipensp self-assigned this Mar 29, 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. 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