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

zig cc and zig c++ do not use stdout with -o - arguments #20709

Open
dasimmet opened this issue Jul 21, 2024 · 0 comments · May be fixed by #20740
Open

zig cc and zig c++ do not use stdout with -o - arguments #20709

dasimmet opened this issue Jul 21, 2024 · 0 comments · May be fixed by #20740
Labels
bug Observed behavior contradicts documented or intended behavior zig cc Zig as a drop-in C compiler feature
Milestone

Comments

@dasimmet
Copy link
Contributor

dasimmet commented Jul 21, 2024

Zig Version

0.14.0-dev.367+a57479afc

Steps to Reproduce and Observed Behavior

When running zig cc or zig c++ with -o -, arguments, the output should be written to stdout, like regular clang or even zig clang does.

With an empty test.h file:

zig c++ -E -x c++-header test.h -o -

this produces a file named - in the current working directory instead, which is especially annoying with running cmake, since it uses CC/CXX with -o - arguments to find compiler features and the c++ standard library.

Expected Behavior

clang-18 -E -x c++-header test.h -o -
zig [clang/c++/cc] -E -x c++-header test.h -o -

output:

# 1 "test.h"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 454 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "test.h" 2
@dasimmet dasimmet added the bug Observed behavior contradicts documented or intended behavior label Jul 21, 2024
@zhylmzr zhylmzr linked a pull request Jul 23, 2024 that will close this issue
@andrewrk andrewrk added the zig cc Zig as a drop-in C compiler feature label Jul 26, 2024
@andrewrk andrewrk added this to the 0.16.0 milestone Jul 26, 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 zig cc Zig as a drop-in C compiler feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants