summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 15:07:36 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 15:07:36 -0300
commit9a5fa17fd3c4885262e31bf14cf495d02e5f6b27 (patch)
tree3be217b0b2b0e9c76e6f41abe8c7fa3aeb35d373 /include
parentc36fee08f6fa7974324438572a260101335cb4b4 (diff)
downloadmariadb-git-9a5fa17fd3c4885262e31bf14cf495d02e5f6b27.tar.gz
Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix warnings flagged by the new warning option -Wunused-but-set-variable that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The option causes a warning whenever a local variable is assigned to but is later unused. It also warns about meaningless pointer dereferences. client/mysql.cc: Meaningless pointer dereferences. client/mysql_upgrade.c: Check whether reading from the file succeeded. extra/comp_err.c: Unused. extra/yassl/src/yassl_imp.cpp: Skip instead of reading data that is discarded. include/my_pthread.h: Variable is only used in debug builds. include/mysys_err.h: Add new error messages. mysys/errors.c: Add new error message for permission related functions. mysys/mf_iocache.c: Variable is only checked under THREAD. mysys/my_copy.c: Raise a error if chmod or chown fails. mysys/my_redel.c: Raise a error if chmod or chown fails. regex/engine.c: Use a equivalent variable for the assert. server-tools/instance-manager/instance_options.cc: Unused. sql/field.cc: Unused. sql/item.cc: Unused. sql/log.cc: Do not ignore the return value of freopen: only set buffer if reopening succeeds. Adjust doxygen comment to the right function. Pass message lenght to log function. sql/mysqld.cc: Do not ignore the return value of freopen: only set buffer if reopening succeeds. sql/partition_info.cc: Unused. sql/slave.cc: No need to set pointer to the address of '\0'. sql/spatial.cc: Unused. Left for historical purposes. sql/sql_acl.cc: Unused. sql/sql_base.cc: Pointers are always set to the same variables. sql/sql_parse.cc: End statement if reading fails. Store the buffer after it has actually been updated. sql/sql_repl.cc: No need to set pointer to the address of '\0'. sql/sql_show.cc: Put variable under the same ifdef block. sql/udf_example.c: Set null pointer flag appropriately. storage/csv/ha_tina.cc: Meaningless dereferences. storage/example/ha_example.cc: Return the error since it's available. storage/myisam/mi_locking.c: Remove unused and dead code.
Diffstat (limited to 'include')
-rw-r--r--include/my_pthread.h5
-rw-r--r--include/mysys_err.h4
2 files changed, 6 insertions, 3 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index eff6a677192..fec7c972a7b 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -269,13 +269,14 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
we want to make sure that no such flags are set.
*/
#if defined(HAVE_SIGACTION) && !defined(my_sigset)
-#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \
+#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; \
+ IF_DBUG(int l_rc); \
DBUG_ASSERT((A) != 0); \
sigemptyset(&l_set); \
l_s.sa_handler = (B); \
l_s.sa_mask = l_set; \
l_s.sa_flags = 0; \
- l_rc= sigaction((A), &l_s, (struct sigaction *) NULL);\
+ IF_DBUG(l_rc=) sigaction((A), &l_s, NULL); \
DBUG_ASSERT(l_rc == 0); \
} while (0)
#elif defined(HAVE_SIGSET) && !defined(my_sigset)
diff --git a/include/mysys_err.h b/include/mysys_err.h
index 09e77248c17..6294b37f773 100644
--- a/include/mysys_err.h
+++ b/include/mysys_err.h
@@ -62,7 +62,9 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_UNKNOWN_COLLATION 28
#define EE_FILENOTFOUND 29
#define EE_FILE_NOT_CLOSED 30
-#define EE_ERROR_LAST 30 /* Copy last error nr */
+#define EE_CHANGE_OWNERSHIP 31
+#define EE_CHANGE_PERMISSIONS 32
+#define EE_ERROR_LAST 32 /* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* exit codes for all MySQL programs */