Skip to content

Interaction of error and -- param produces different results in output of 3c #343

Closed
@kyleheadley

Description

@kyleheadley

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:

warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
/Users/kyleheadley/Documents/Projects/3C/checkedc-testing/build/../clang/test/3C/allocator.c:13:1: error: 
      unknown type name '_Itype_for_any'
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_...
^

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions