Skip to content

zig cc: consider enabling -Wall -Werror by default #21561

Open
@myaaaaaaaaa

Description

@myaaaaaaaaa

By default, programs like this will abort with an illegal instruction due to UBSAN:

int main() {
	int i = 100;
	i <<= i;
	return i;
}

However, programs like this will compile and run successfully:

int main() {
	int i;
	return i;
}

Since zig already enables runtime checks for undefined behavior by default, it doesn't seem like too much of a stretch to enable compile-time checks as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.zig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions