• Sergei Golubchik's avatar
    improve strmake_buf() to detect wrong usage reliably · 479bd5a6
    Sergei Golubchik authored
    strmake_buf() macro should only be used with char[] arrays,
    and never with char* pointers. To distinguish between the two
    we create a new variable of the same type and initialize it
    using array initializer, this causes compilation failure
    with pointers. The variable is unused and will be removed by the
    compiler. It's enough to do this check only with gcc, so
    it doesn't have to be portable.
    479bd5a6
m_string.h 7.37 KB