Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I mean in the sense of expanding the macro. It doesn't look at the type of operand at the macro expansion step, it simply replaces it with the _Generic() function call, which contains all the expressions, and each expression is parsed, and thus must be valid.


> It doesn't look at the type

> each expression is parsed, and thus must be valid.

There's multiple kinds of "valid".

The code has valid syntax but invalid types.

The preprocessor doesn't understand types, so it can't know the code has invalid types, right? So this error is not happening in the preprocessor, right?

Therefore changing this behavior would not require preprocessor changes/shoehorning. This error is not a consequence of how the preprocessor works.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: