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

With GCC specifics, you can define MAX as a macro without calling the function twice.

  #define max(a,b) \
        ({ typeof (a) _a = (a); \
        typeof (b) _b = (b); \
        _a > _b ? _a : _b; })


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: