We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi I'm compiling to freestanding and my generated C headers end up including things from std.
I only export the void main function and the other imports never import anything from the standard. compile flags:
zig build-obj zworld.zig -target i386-freestanding-elfv1 -fno-PIC -I .
zig file:
const c = @cImport({ @cInclude("types.h"); @cInclude("user.h"); }); export fn main() void { c.printf(2, "hello world"); c.exit(); }
generated header:
#ifndef ZWORLD_H #define ZWORLD_H #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif void main(void); #ifdef __cplusplus } // extern "C" #endif #endif // ZWORLD_H
The text was updated successfully, but these errors were encountered:
Don't include stdbool.h for void and unreachable
6bb75e7
Fixes ziglang#4272
This is a bug, but both stdint.h and stdbool.h are present in even freestanding C implementations.
stdint.h
stdbool.h
Sorry, something went wrong.
Hmm ok I guess you need stdbool and int for compatibility with zig primitives? Makes sense thanks!
3d8328a
Fixes #4272
Successfully merging a pull request may close this issue.
Hi I'm compiling to freestanding and my generated C headers end up including things from std.
I only export the void main function and the other imports never import anything from the standard.
compile flags:
zig build-obj zworld.zig -target i386-freestanding-elfv1 -fno-PIC -I .
zig file:
generated header:
The text was updated successfully, but these errors were encountered: