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

Treat global variables differently #50

Open
MilkeeyCat opened this issue Aug 29, 2024 · 0 comments
Open

Treat global variables differently #50

MilkeeyCat opened this issue Aug 29, 2024 · 0 comments
Labels
codegen Codegen related enhancement New feature or request

Comments

@MilkeeyCat
Copy link
Owner

MilkeeyCat commented Aug 29, 2024

If you try to put this

u8 AF_INET = 2;
u8 SOCK_DGRAM = 2;

in global scope and compile it will generate

.comm AF_INET 1
mov byte ptr [AF_INET], 2
.comm SOCK_DGRAM 1
mov byte ptr [SOCK_DGRAM], 2

which is fucking wrong, instead global variables should be treated differently and they should be allowed to have only compile time expression as initializer

@MilkeeyCat MilkeeyCat added enhancement New feature or request codegen Codegen related labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen Codegen related enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant