While trying to compile xtrabackup from source I've found a peculiar line of code in sql/sql_acl.cc that GCC is refusing to compile without a more permissive setting. This line is the problem:
if (combo->plugin.str == NULL || combo->plugin.str == '\0')
Which immediately raises the following error:
error: ISO C++ forbids comparison between pointer and integer
This seems entirely reasonable given the code in question. The plugin value is of this type:
struct st_mysql_lex_string
{
char *str;
size_t length;
};
Where that's a simple MySQL internal structure that represents a string pointer + length pair, so in this case str is merely char*, nothing special.
I know that cross-platform development and dealing with baroque compiler environments can require a certain level of paranoia, but what, if any, justification is there for this double NULL check? I can't think of how the second clause would ever be true if the first wasn't, but I might be missing some unusual edge case.