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

As explained in the article linked at the top ("LWN recently looked at the kernel's max() macro"), the issue isn't one of optimization, it's one of syntax. Sure, a decently optimizing compiler can optimize __cmp_once in to a constant value. However, C99 requires that non-VLA arrays have a size that is a constant expression, which is a syntax thing; even though GCC knows that __cmp_once evaluates to a constant value, the resulting C coming out of the preprocessor is of the wrong syntactic shape.


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

Search: