File ntfs-3g-warnings.patch of Package NTFS-3g
fusermount.c: In function 'mount_fuse':
fusermount.c:657: warning: ignoring return value of 'fchdir', declared with attribute warn_unused_result
# Checked with author of ntfs-3g: Currently it's best to ignore the return value (for now, not critical)
--- libfuse-lite/fusermount.c 2008/02/18 15:49:32 1.1
+++ libfuse-lite/fusermount.c 2008/02/18 16:34:13
@@ -654,6 +654,7 @@
&source, &mnt_opts);
if (currdir_fd != -1) {
+ __attribute__((unused))int ignored_fchdir_status =
fchdir(currdir_fd);
close(currdir_fd);
}
attrib.c:144: error: passing argument 1 of 'ntfs_log_redirect' discards qualifiers from pointer target type
--- include/ntfs-3g/logging.h 2008/02/18 18:09:34 1.1
+++ include/ntfs-3g/logging.h 2008/02/18 18:10:21
@@ -88,23 +88,23 @@
/* Macros to simplify logging. One for each level defined above.
* Note, ntfs_log_debug/trace have effect only if DEBUG is defined.
*/
-#define ntfs_log_critical(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_CRITICAL,NULL,FORMAT,##ARGS)
-#define ntfs_log_error(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_ERROR,NULL,FORMAT,##ARGS)
-#define ntfs_log_info(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_INFO,NULL,FORMAT,##ARGS)
-#define ntfs_log_perror(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_PERROR,NULL,FORMAT,##ARGS)
-#define ntfs_log_progress(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_PROGRESS,NULL,FORMAT,##ARGS)
-#define ntfs_log_quiet(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_QUIET,NULL,FORMAT,##ARGS)
-#define ntfs_log_verbose(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_VERBOSE,NULL,FORMAT,##ARGS)
-#define ntfs_log_warning(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_WARNING,NULL,FORMAT,##ARGS)
+#define ntfs_log_critical(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_CRITICAL,NULL,FORMAT,##ARGS)
+#define ntfs_log_error(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_ERROR,NULL,FORMAT,##ARGS)
+#define ntfs_log_info(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_INFO,NULL,FORMAT,##ARGS)
+#define ntfs_log_perror(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_PERROR,NULL,FORMAT,##ARGS)
+#define ntfs_log_progress(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_PROGRESS,NULL,FORMAT,##ARGS)
+#define ntfs_log_quiet(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_QUIET,NULL,FORMAT,##ARGS)
+#define ntfs_log_verbose(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_VERBOSE,NULL,FORMAT,##ARGS)
+#define ntfs_log_warning(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_WARNING,NULL,FORMAT,##ARGS)
/* By default debug and trace messages are compiled into the program,
* but not displayed.
*/
#ifdef DEBUG
-#define ntfs_log_debug(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_DEBUG,NULL,FORMAT,##ARGS)
-#define ntfs_log_trace(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_TRACE,NULL,FORMAT,##ARGS)
-#define ntfs_log_enter(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_ENTER,NULL,FORMAT,##ARGS)
-#define ntfs_log_leave(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_LEAVE,NULL,FORMAT,##ARGS)
+#define ntfs_log_debug(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_DEBUG,NULL,FORMAT,##ARGS)
+#define ntfs_log_trace(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_TRACE,NULL,FORMAT,##ARGS)
+#define ntfs_log_enter(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_ENTER,NULL,FORMAT,##ARGS)
+#define ntfs_log_leave(FORMAT, ARGS...) ntfs_log_redirect((const char *)__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_LEAVE,NULL,FORMAT,##ARGS)
#else
#define ntfs_log_debug(FORMAT, ARGS...)do {} while (0)
#define ntfs_log_trace(FORMAT, ARGS...)do {} while (0)
# unistr.c: In function 'ntfs_mbstoucs':
# unistr.c:540: error: passing argument 2 of 'mbsrtowcs' from incompatible pointer type
--- libntfs-3g/unistr.c 2008/02/18 18:26:20 1.1
+++ libntfs-3g/unistr.c 2008/02/18 18:26:32
@@ -537,7 +537,7 @@
s = ins;
#if defined(HAVE_MBSINIT)
memset(&mbstate, 0, sizeof(mbstate));
- ins_len = mbsrtowcs(NULL, (const char **)&s, 0, &mbstate);
+ ins_len = mbsrtowcs(NULL, (__const char **)&s, 0, &mbstate);
#ifdef __CYGWIN32__
if (!ins_len && *ins) {
/* Older Cygwin had broken mbsrtowcs() implementation. */
# Fix -Wformat-security:
utils.c:135: error: format not a string literal and no format arguments
--- libntfs-3g/logging.c
+++ libntfs-3g/logging.c
@@ -451,7 +451,7 @@ int ntfs_log_handler_fprintf(const char
}
if (col_prefix)
- ret += fprintf(stream, col_prefix);
+ ret += fprintf(stream, "%s", col_prefix);
if ((ntfs_log.flags & NTFS_LOG_FLAG_ONLYNAME) &&
(strchr(file, PATH_SEP))) /* Abbreviate the filename */
@@ -476,7 +476,7 @@ int ntfs_log_handler_fprintf(const char
ret += fprintf(stream, ": %s\n", strerror(olderr));
if (col_suffix)
- ret += fprintf(stream, col_suffix);
+ ret += fprintf(stream, "%s", col_suffix);
fflush(stream);
--- src/ntfs-3g.c
+++ src/ntfs-3g.c
@@ -2045,7 +2045,7 @@ static void mknod_dev_fuse(const char *d
if (mknod(dev, S_IFCHR | 0666, makedev(10, 229))) {
ntfs_log_perror("Failed to create '%s'", dev);
if (errno == EPERM)
- ntfs_log_error(dev_fuse_msg);
+ ntfs_log_error("%s", dev_fuse_msg);
}
umask(mask);
}
@@ -2314,7 +2314,7 @@ int main(int argc, char *argv[])
#if defined(linux) || defined(__uClinux__)
if (S_ISBLK(sbuf.st_mode) && (fstype == FSTYPE_FUSE))
- ntfs_log_info(fuse26_kmod_msg);
+ ntfs_log_info("%s", fuse26_kmod_msg);
#endif
setup_logging(parsed_options);
--- src/utils.c
+++ src/utils.c
@@ -132,7 +132,7 @@ void utils_mount_error(const char *volum
ntfs_log_error(hibernated_volume_msg, volume, mntpoint);
break;
case NTFS_VOLUME_UNCLEAN_UNMOUNT:
- ntfs_log_error(unclean_journal_msg);
+ ntfs_log_error("%s", unclean_journal_msg);
ntfs_log_error(forced_mount_msg, volume, mntpoint,
volume, mntpoint);
break;
# Happens only on SLES9 x86_64:
device.c: In function `ntfs_cluster_read':
device.c:411: warning: long long int format, long int arg (arg 8)
device.c: In function `ntfs_cluster_write':
device.c:447: warning: long long int format, long int arg (arg 8)
--- libntfs-3g/device.c
+++ libntfs-3g/device.c
@@ -410,7 +410,7 @@ s64 ntfs_cluster_read(const ntfs_volume
errno = ESPIPE;
ntfs_log_perror("Trying to read outside of volume "
"(%lld < %lld)", (long long)vol->nr_clusters,
- (long long)lcn + count);
+ (long long)(lcn + count));
return -1;
}
br = ntfs_pread(vol->dev, lcn << vol->cluster_size_bits,
@@ -446,7 +446,7 @@ s64 ntfs_cluster_write(const ntfs_volume
errno = ESPIPE;
ntfs_log_perror("Trying to write outside of volume "
"(%lld < %lld)", (long long)vol->nr_clusters,
- (long long)lcn + count);
+ (long long)(lcn + count));
return -1;
}
if (!NVolReadOnly(vol))
# Happens only on SLES9 x86_64:
mft.c: In function `ntfs_mft_records_read':
mft.c:97: warning: long long int format, long int arg (arg 7)
mft.c: In function `ntfs_mft_records_write':
mft.c:160: warning: long long int format, long int arg (arg 7)
--- libntfs-3g/mft.c
+++ libntfs-3g/mft.c
@@ -95,7 +95,7 @@ int ntfs_mft_records_read(const ntfs_vol
vol->mft_record_size_bits) {
errno = ESPIPE;
ntfs_log_perror("Trying to read non-allocated mft records "
- "(%lld > %lld)", (long long)m + count,
+ "(%lld > %lld)", (long long)(m + count),
(long long)vol->mft_na->initialized_size >>
vol->mft_record_size_bits);
return -1;
@@ -158,7 +158,7 @@ int ntfs_mft_records_write(const ntfs_vo
vol->mft_record_size_bits) {
errno = ESPIPE;
ntfs_log_perror("Trying to write non-allocated mft records "
- "(%lld > %lld)", (long long)m + count,
+ "(%lld > %lld)", (long long)(m + count),
(long long)vol->mft_na->initialized_size >>
vol->mft_record_size_bits);
return -1;