`zig cc` can't accept -- in args
Zig Version
0.11.0-dev.1898+36d47dd19
Steps to Reproduce and Observed Behavior
> zig cc -- program.c
error: Unknown Clang option: '--'
Expected Behavior
It should parse like clang. args after -- are not flags.
Are you sure that's actually how clang works? I ran clang -- -program.c where -program.c exists and it said:
error: unknown argument: '-program.c'
-program.c should be a file name, if your C file starts with -.
Yes, clang for me shows that error message when -program.c is the name of a C source file. My clang version is 15.0.7, what version are you on?
Yes, clang for me shows that error message when
-program.cis the name of a C source file. My clang version is 15.0.7, what version are you on?
I gave a bad example. What about clang -- program.c
Strange, I've found that actually clang for me does process the -- as expected, even with -program.c... but only if -program.c doesn't exist.
clang -- -program.c where -program.c doesn't exist:
clang-15: error: no such file or directory: '-program.c'
clang-15: error: no input files
clang -- -program.c where it does exist:
error: unknown argument: '-program.c'
Did we find a bug in clang?
I dunno, seems like it :shrug:
This is not demonstrated to be a bug yet. Please improve the bug report
This is not demonstrated to be a bug yet. Please improve the bug report
Updated