-
Notifications
You must be signed in to change notification settings - Fork 5
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
Interaction of error and --
param produces different results in output of 3c
#343
Comments
After a few more encounters with this bug, it seems that my system is running 3c in C++ mode, as mentioned in the error. The |
I think I figured out what is going on here. A little-known feature of LibTooling (on which LibTooling computes the absolute path of the first source file by prepending the working directory. In the first case, this is My conclusion: If we want to run Are we OK with keeping LibTooling's "standard" behavior (but documenting it better for our users in the |
We decided to keep the standard use of |
- Add -output-dir option to write updated files to a directory structure parallel to the base dir (#347). When -output-dir is used, a source file outside the base dir can't be handled because there is no way to compute its output path. For consistency, this is now an error even when -output-dir is not used. - Convert all 3C regression tests from -output-postfix to -output-dir to avoid leaving temporary files in the clang/test/3C directory (#378). - Expand "3c -help" documentation. In particular, direct the user to pass "--" when they don't want to use a compilation database to avoid accidentally using unwanted compiler options and suppress the warning if no compilation database is found (#343). - For consistency, have stdout mode output the main file even if it is unchanged (#328). - Fix bugs in matching of file paths against the base dir (#327). - Other minor bug fixes: see the pull request description for details. Co-authored-by: John Kastner <[email protected]>
When running 3c from the top directory of the clang project, I get the usual message about a missing compile_commands, and otherwise the following produces the expected output
build/bin/3c clang/test/3C/allocator.c > outfile
However, running the equivalent command from the build directory, ie
bin/3c ../clang/test/3C/allocator.c > outfile
produces an non-rewritten "foo" function along with some errors starting with:This could be a configuration issue on my machine, or could be a side affect of the compile_commands file in that directory.
The strange part is that when adding the dashes, i.e.
bin/3c ../clang/test/3C/allocator.c -- > outfile
all console messages are suppressed and the output is the correctly rewritten result.So
--
is either incorrectly suppressing an error (an undefined malloc should be marked WILD), or is selecting a different project configuration (choosing a malloc that is defined). Or something else. Either way this seems to be undesirable.The text was updated successfully, but these errors were encountered: