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

Pointer in type statement doesn't work #19399

Closed
alex-s168 opened this issue Sep 21, 2023 · 0 comments · Fixed by #19452
Closed

Pointer in type statement doesn't work #19399

alex-s168 opened this issue Sep 21, 2023 · 0 comments · Fixed by #19452
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. Unit: Type System Bugs/feature requests, that are related to the V types system.

Comments

@alex-s168
Copy link

alex-s168 commented Sep 21, 2023

Describe the bug

When I use the "type" statement to define a type that is a reference to a struct, it "ignores" the reference.

Reproduction Steps

V code:

#include "test.h"

struct C.atype {}

type BType = &C.atype

test.h:

struct atype;

Expected Behavior

The generated C code looking like this:

typedef struct atype *main__BType;

Current Behavior

The generated C code looks like this:

typedef struct atype main__BType;

Possible Solution

No response

Additional Information/Context

No response

V version

0.4.1 7169df3

Environment details (OS name and version, etc.)

V full version: V 0.4.1 7b306e9.7169df3
OS: linux, Ubuntu 23.04
Processor: 12 cpus, 64bit, little endian, AMD Ryzen 5 7600X 6-Core Processor

Git version: git version 2.39.2
Git vroot status: weekly.2023.30-348-g7169df3e
.git/config present: true

CC version: cc (Ubuntu 11.4.0-1ubuntu1~23.04) 11.4.0
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3

Important

You can vote for this issue using the 👍 reaction. More votes increase the issue's priority
for developers.

Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.

@alex-s168 alex-s168 added the Bug This tag is applied to issues which reports bugs. label Sep 21, 2023
@ArtemkaKun ArtemkaKun added Unit: Type System Bugs/feature requests, that are related to the V types system. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. labels Sep 21, 2023
@Delta456 Delta456 self-assigned this Sep 27, 2023
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. Unit: Type System Bugs/feature requests, that are related to the V types system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants