-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Description
Zig Version
0.15.1
Steps to Reproduce and Observed Behavior
/* test.c */
#include <limits.h>// build.zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.resolveTargetQuery(.{
.cpu_arch = .thumb,
.cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m3 },
.abi = .eabi,
.os_tag = .freestanding,
.ofmt = .elf,
});
const optimize = b.standardOptimizeOption(.{});
const libc = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = false,
.link_libcpp = false,
});
libc.single_threaded = true;
libc.addCSourceFiles(.{
.files = &[_][]const u8{
"test.c",
},
.flags = &.{
"-std=gnu99",
"-nostdlib",
"-nostdinc",
},
});
const picolibc = b.addLibrary(.{
.linkage = .static,
.root_module = libc,
.name = "c",
});
b.installArtifact(picolibc);
}When building this, the build should fail due to no limits.h present. However, the default include from Zig -isystem /opt/homebrew/Cellar/zig/0.15.1/lib/zig/include prevents this.
When building, for example, picolibc for embedded targets, this breaks the build because limits.h is a mismatch.
Expected Behavior
The build should fail due to missing include.
Metadata
Metadata
Assignees
Labels
No labels