drpriver

Results 15 comments of drpriver

A test case: ```C void i_do_not_exist(void); __forceinline void i_am_not_called(void){ i_do_not_exist(); } int main(){ return 0; } ``` This should link successfully as `i_am_not_called` is dead code. --- Code like this...

To be clear, the issue occurs if you actually compile the C code instead of just importing it.

Issue also occurs with regular `inline`, which is unsurprising as `inline`/`__attribute__((always_inline))` just get mapped to a `pragma(inline, true)` in the dmd C parser. Testing with gcc/clang/cl on mac/linux/windows they all...

C standard on definition of `inline` may be relevant: > For a function with external linkage, the following restrictions apply: If a function is declared with an inline function specifier,...

> > And for what it’s worth, ldc is also able to link the example program even without a __forceinline or inline, which is actually weird as gcc/clang fails to...

Hacky workaround would be to make them templates so they only get instantiated on use.

I have a branch that implements this, but it’s unclear if it is a desired feature or not.

Hmm, one difference is that if you put that in a C header it will get included in your translation unit and thus you get the lib comment. But if...

I think I found the root cause, we're getting some unanticipated aliasing of types that the semantic routines aren't setup to handle due to the way C typedefs are getting...