From 183710558f78bb2fa55640ef1f0d2e087355240e Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 19 Oct 2010 11:49:31 -0200 Subject: Bug#45288: pb2 returns a lot of compilation warnings on linux Fix assorted compiler warnings on Mac OS X. BUILD/SETUP.sh: Remove -Wctor-dtor-privacy flag to workaround a GCC bug that causes it to not properly detect that implicitly generated constructors are always public. cmd-line-utils/readline/terminal.c: tgetnum and tgetflag might not take a const string argument. mysys/my_gethostbyname.c: Tag unused arguments. mysys/my_sync.c: Tag unused arguments. --- mysys/my_sync.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'mysys/my_sync.c') diff --git a/mysys/my_sync.c b/mysys/my_sync.c index 97540f5eb48..d6ca4f1c1df 100644 --- a/mysys/my_sync.c +++ b/mysys/my_sync.c @@ -89,6 +89,8 @@ int my_sync(File fd, myf my_flags) static const char cur_dir_name[]= {FN_CURLIB, 0}; + + /* Force directory information to disk. @@ -100,9 +102,11 @@ static const char cur_dir_name[]= {FN_CURLIB, 0}; RETURN 0 if ok, !=0 if error */ + +#ifdef NEED_EXPLICIT_SYNC_DIR + int my_sync_dir(const char *dir_name, myf my_flags) { -#ifdef NEED_EXPLICIT_SYNC_DIR File dir_fd; int res= 0; const char *correct_dir_name; @@ -124,11 +128,18 @@ int my_sync_dir(const char *dir_name, myf my_flags) else res= 1; DBUG_RETURN(res); -#else +} + +#else /* NEED_EXPLICIT_SYNC_DIR */ + +int my_sync_dir(const char *dir_name __attribute__((unused)), + myf my_flags __attribute__((unused))) +{ return 0; -#endif } +#endif /* NEED_EXPLICIT_SYNC_DIR */ + /* Force directory information to disk. @@ -141,15 +152,24 @@ int my_sync_dir(const char *dir_name, myf my_flags) RETURN 0 if ok, !=0 if error */ + +#ifdef NEED_EXPLICIT_SYNC_DIR + int my_sync_dir_by_file(const char *file_name, myf my_flags) { -#ifdef NEED_EXPLICIT_SYNC_DIR char dir_name[FN_REFLEN]; size_t dir_name_length; dirname_part(dir_name, file_name, &dir_name_length); return my_sync_dir(dir_name, my_flags); -#else +} + +#else /* NEED_EXPLICIT_SYNC_DIR */ + +int my_sync_dir_by_file(const char *file_name __attribute__((unused)), + myf my_flags __attribute__((unused))) +{ return 0; -#endif } +#endif /* NEED_EXPLICIT_SYNC_DIR */ + -- cgit v1.2.1 From 7406b38efa0a2eec5a245839c5ce13b85d51d125 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 19 Oct 2010 14:48:03 -0200 Subject: Bug#45288: pb2 returns a lot of compilation warnings Ensure that fdatasync is properly declared as on Mac OS X, the function is available but there is no prototype. Also, port a fix for a warning from the InnoDB plugin over to the builtin. configure.in: Check that fdatasync is declared. mysys/my_sync.c: Use fdatasync only if it is declared. storage/innobase/include/ut0dbg.h: Port over from the plugin a fix for a warning. --- mysys/my_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysys/my_sync.c') diff --git a/mysys/my_sync.c b/mysys/my_sync.c index d6ca4f1c1df..7acbccec345 100644 --- a/mysys/my_sync.c +++ b/mysys/my_sync.c @@ -58,7 +58,7 @@ int my_sync(File fd, myf my_flags) /* Some file systems don't support F_FULLFSYNC and fail above: */ DBUG_PRINT("info",("fcntl(F_FULLFSYNC) failed, falling back")); #endif -#if defined(HAVE_FDATASYNC) +#if defined(HAVE_FDATASYNC) && HAVE_DECL_FDATASYNC res= fdatasync(fd); #elif defined(HAVE_FSYNC) res= fsync(fd); -- cgit v1.2.1