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

cgen error for program compiled with -autofree #21837

Open
spytheman opened this issue Jul 9, 2024 · 0 comments
Open

cgen error for program compiled with -autofree #21837

spytheman opened this issue Jul 9, 2024 · 0 comments
Labels
Autofree Bugs/feature requests, that are related to -autofree. Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general.

Comments

@spytheman
Copy link
Member

spytheman commented Jul 9, 2024

V doctor:

V full version: V 0.4.6 c689f80.66ea826
OS: linux, Ubuntu 20.04.6 LTS
Processor: 2 cpus, 64bit, little endian, Intel(R) Core(TM) i3-3225 CPU @ 3.30GHz

getwd: /space/v/oo
vexe: /space/v/oo/v
vexe mtime: 2024-07-09 14:39:24

vroot: OK, value: /space/v/oo
VMODULES: OK, value: /home/delian/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.43.2
Git vroot status: weekly.2024.27-36-g494be205
.git/config present: true

CC version: cc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5

What did you do?
v -g -o vdbg cmd/v && ./vdbg -autofree x.v

struct Abc {}

struct Xyz {}

fn (a Abc) emethod() !Xyz {
	return Xyz{}
}

fn f() !string {
	a := Abc{}
	return a.emethod()!.str().all_before(':')
}

x := f()!
dump(x)

What did you expect to see?

A compiled program, even with -autofree

What did you see instead?

#1 21:31:30 ^ master /v/oo>v -g -o vdbg cmd/v && ./vdbg -autofree x.v
==================
/tmp/v_1000/x.01J2CC7T6XBRCXX4428TTY1JYR.tmp.c:13140: error: 'lt' undeclared
...
==================
(Use `v -cg` to print the entire error message)

#1 21:31:34 ^ master /v/oo>

The above is a simplification discovered, while debugging a CI failure for #21831 .

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.

@spytheman spytheman added Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Autofree Bugs/feature requests, that are related to -autofree. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. labels Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Autofree Bugs/feature requests, that are related to -autofree. Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general.
Projects
None yet
Development

No branches or pull requests

1 participant