improve strmake_buf() to detect wrong usage reliably
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.
Showing
Please register or sign in to comment