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)
Index: libfuse-lite/fusermount.c
===================================================================
--- libfuse-lite/fusermount.c.orig
+++ libfuse-lite/fusermount.c
@@ -588,6 +588,7 @@ static int mount_fuse(const char *mnt, c
&source, &mnt_opts);
if (currdir_fd != -1) {
+ __attribute__((unused))int ignored_fchdir_status =
fchdir(currdir_fd);
close(currdir_fd);
}
Index: include/ntfs-3g/logging.h
===================================================================
--- include/ntfs-3g/logging.h.orig
+++ include/ntfs-3g/logging.h
@@ -91,23 +91,23 @@ int ntfs_log_redirect(const char *functi
/* 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)
Index: libntfs-3g/unistr.c
===================================================================
--- libntfs-3g/unistr.c.orig
+++ libntfs-3g/unistr.c
@@ -531,7 +531,7 @@ int ntfs_mbstoucs(const char *ins, ntfsc
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. */
Index: libntfs-3g/logging.c
===================================================================
--- libntfs-3g/logging.c.orig
+++ libntfs-3g/logging.c
@@ -472,7 +472,7 @@ int ntfs_log_handler_fprintf(const char
ret += fprintf(stream, " ");
#endif
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 */
@@ -497,7 +497,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);
#ifdef DEBUG
if (level == NTFS_LOG_LEVEL_ENTER)
Index: src/ntfs-3g.c
===================================================================
--- src/ntfs-3g.c.orig
+++ src/ntfs-3g.c
@@ -731,7 +731,7 @@ static int ntfs_fuse_write(const char *o
if (0 <= ret && ret < (s64)size)
ntfs_log_perror("ntfs_attr_pwrite partial write to '%s'"
" (%lld: %lld <> %lld)", path, (long long)offset,
- (long long)size, ret);
+ (long long)size, (long long)ret);
if (ret <= 0) {
res = -errno;
goto exit;
@@ -2014,7 +2014,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);
}
@@ -2291,7 +2291,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);
Index: src/utils.c
===================================================================
--- src/utils.c.orig
+++ src/utils.c
@@ -133,7 +133,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;
Index: libntfs-3g/device.c
===================================================================
--- libntfs-3g/device.c.orig
+++ 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))
Index: libntfs-3g/mft.c
===================================================================
--- libntfs-3g/mft.c.orig
+++ 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;
@@ -157,7 +157,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;
@@ -612,7 +612,7 @@ leave:
return ret;
}
-int ntfs_mft_attr_extend(ntfs_volume *vol, ntfs_attr *na)
+int ntfs_mft_attr_extend(__attribute__((unused)) ntfs_volume *vol, ntfs_attr *na)
{
int ret = STATUS_ERROR;
ntfs_log_enter("Entering\n");
@@ -1498,7 +1498,7 @@ undo_mftbmp_alloc:
err_out:
if (!errno)
errno = EIO;
-err_exit:
+/*err_exit:*/
ni = NULL;
goto out;
}