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

translate-c: forward declared variables override definition #21477

Open
ypsvlq opened this issue Sep 21, 2024 · 0 comments
Open

translate-c: forward declared variables override definition #21477

ypsvlq opened this issue Sep 21, 2024 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior translate-c C to Zig source translation feature (@cImport)
Milestone

Comments

@ypsvlq
Copy link
Contributor

ypsvlq commented Sep 21, 2024

Zig Version

0.14.0-dev.1632+d83a3f174

Steps to Reproduce and Observed Behavior

extern const int x;
const int x = 1;

is translated to

pub extern const x: c_int;

Expected Behavior

It should be translated to

pub export const x: c_int = 1;
@ypsvlq ypsvlq added the bug Observed behavior contradicts documented or intended behavior label Sep 21, 2024
@Vexu Vexu added the translate-c C to Zig source translation feature (@cImport) label Sep 21, 2024
@Vexu Vexu added this to the 0.15.0 milestone Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior translate-c C to Zig source translation feature (@cImport)
Projects
None yet
Development

No branches or pull requests

2 participants