Skip to content

Commit cfaf47a

Browse files
committed
acl - is_public - avoid embedded warning
Using clang generates the unused-function warning on embedded like: FAILED: libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_acl.cc.o /usr/lib64/ccache/clang++ .... libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_acl.cc.o -MF libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_acl.cc.o.d -o libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_acl.cc.o -c /home/dan/repos/mariadb-server-10.11/sql/sql_acl.cc sql_acl.cc:113:20: error: unused function 'is_public' [-Werror,-Wunused-function] static inline bool is_public(const LEX_USER *l) { return is_public(&l->user); }
1 parent 22491e6 commit cfaf47a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sql/sql_acl.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ LEX_CSTRING current_user_and_current_role=
108108
LEX_CSTRING none= {STRING_WITH_LEN("NONE") };
109109
LEX_CSTRING public_name= {STRING_WITH_LEN("PUBLIC") };
110110

111-
static inline bool is_public(const char *l) { return l == public_name.str; }
112-
static inline bool is_public(const LEX_CSTRING *l) { return is_public(l->str); }
113-
static inline bool is_public(const LEX_USER *l) { return is_public(&l->user); }
114-
115111
static plugin_ref old_password_plugin;
116112
static plugin_ref native_password_plugin;
117113

@@ -135,6 +131,10 @@ struct acl_host_and_ip
135131

136132
#ifndef NO_EMBEDDED_ACCESS_CHECKS
137133
static bool compare_hostname(const acl_host_and_ip *, const char *, const char *);
134+
static inline bool is_public(const char *l) { return l == public_name.str; }
135+
static inline bool is_public(const LEX_CSTRING *l) { return is_public(l->str); }
136+
static inline bool is_public(const LEX_USER *l) { return is_public(&l->user); }
137+
138138
#else
139139
#define compare_hostname(X,Y,Z) 0
140140
#endif

0 commit comments

Comments
 (0)