Hi everybody,

i'm a member of the openSUSE community and took on the task to updtae our ntfs-3g package to the currently latest version 2009.11.15.

We're using the -Werror compile switch and this leads to a multitude of build failures, many of which we had with 2009.04 release already, some new ones and some I seem not to get around with.

for your reference I attach the current patch we have (most of the changes were already the same for the 2009.04 release, so far new are all changes in secaudit.[ch]).

Nevertheless, so far I get stuck with the build error:

*********************

gcc -DHAVE_CONFIG_H -I. -I.. -I../include/ntfs-3g -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wformat -Wformat-security -W -Wno-sign-compare -Werror -Wall -MT ntfs_3g_secaudit-secaudit.o -MD -MP -MF .deps/ntfs_3g_secaudit-secaudit.Tpo -c -o ntfs_3g_secaudit-secaudit.o `test -f 'secaudit.c' || echo './'`secaudit.c
secaudit.c:1813: error: conflicting types for 'relay_find_usid'
secaudit.h:725: note: previous declaration of 'relay_find_usid' was here
secaudit.c:1824: error: conflicting types for 'relay_find_gsid'
secaudit.h:727: note: previous declaration of 'relay_find_gsid' was here
secaudit.c:1835: error: conflicting types for 'relay_find_user'
secaudit.h:729: note: previous declaration of 'relay_find_user' was here
secaudit.c:1848: error: conflicting types for 'relay_find_group'
secaudit.h:730: note: previous declaration of 'relay_find_group' was here
cc1: warnings being treated as errors
secaudit.c: In function 'linux_permissions':
secaudit.c:1937: error: assignment discards qualifiers from pointer target type
secaudit.c: In function 'linux_owner':
secaudit.c:1964: error: assignment discards qualifiers from pointer target type
secaudit.c: In function 'setfull':
secaudit.c:4350: error: assignment discards qualifiers from pointer target type
secaudit.c: At top level:
secaudit.c:6618: error: conflicting types for 'dumpalloc'
secaudit.h:714: note: previous declaration of 'dumpalloc' was here
secaudit.c:6631: error: conflicting types for 'chkmalloc'
secaudit.h:710: note: previous declaration of 'chkmalloc' was here
secaudit.c:6652: error: conflicting types for 'chkcalloc'
secaudit.h:711: note: previous declaration of 'chkcalloc' was here
secaudit.c:6657: error: conflicting types for 'chkfree'
secaudit.h:712: note: previous declaration of 'chkfree' was here
secaudit.c:6701: error: conflicting types for 'chkisalloc'
secaudit.h:713: note: previous declaration of 'chkisalloc' was here
make[2]: *** [ntfs_3g_secaudit-secaudit.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/ntfs_3g_usermap-usermap.Tpo .deps/ntfs_3g_usermap-usermap.Po
make[2]: Leaving directory `/usr/src/packages/BUILD/ntfs-3g-2009.11.14/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/ntfs-3g-2009.11.14'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.mJ5QZH (%build)


*****************

I 'synched' the protoype from secaudit.h already with the function declaration in secaudit.c, but this seems not to help me here.

I would appreciate if somebody could have a look at this and maybe give me some pointers.

Best regards,
Dominique
Index: ntfs-3g-2009.11.14/libfuse-lite/fusermount.c
===================================================================
--- ntfs-3g-2009.11.14.orig/libfuse-lite/fusermount.c
+++ ntfs-3g-2009.11.14/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: ntfs-3g-2009.11.14/src/usermap.c
===================================================================
--- ntfs-3g-2009.11.14.orig/src/usermap.c
+++ ntfs-3g-2009.11.14/src/usermap.c
@@ -708,8 +708,8 @@ STATIC boolean recurse(const char *accna
 STATIC boolean recurse(const char *accname, const char *dir, int levels, int docset);
 
 STATIC int callback(struct CALLBACK *context, char *ntfsname,
-	int length, int type, long long pos, unsigned long long mft_ref,
-	unsigned int dt_type)
+	int length, int type, __attribute__((unused)) long long pos, __attribute__((unused))unsigned long long mft_ref,
+	__attribute__((unused))unsigned int dt_type)
 {
 	char *fullname;
 	char *accname;
@@ -1223,7 +1223,7 @@ STATIC boolean sanitize(void)
 	return (ok);
 }
 
-STATIC boolean checkoptions(int argc, char *argv[], boolean silent)
+STATIC boolean checkoptions(int argc, __attribute__((unused))char *argv[], __attribute__((unused))boolean silent)
 {
 	boolean err;
 #ifdef WIN32
Index: ntfs-3g-2009.11.14/include/ntfs-3g/logging.h
===================================================================
--- ntfs-3g-2009.11.14.orig/include/ntfs-3g/logging.h
+++ ntfs-3g-2009.11.14/include/ntfs-3g/logging.h
@@ -90,23 +90,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: ntfs-3g-2009.11.14/libntfs-3g/unistr.c
===================================================================
--- ntfs-3g-2009.11.14.orig/libntfs-3g/unistr.c
+++ ntfs-3g-2009.11.14/libntfs-3g/unistr.c
@@ -942,7 +942,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: ntfs-3g-2009.11.14/src/secaudit.c
===================================================================
--- ntfs-3g-2009.11.14.orig/src/secaudit.c
+++ ntfs-3g-2009.11.14/src/secaudit.c
@@ -1845,7 +1845,7 @@ uid_t relay_find_user(const struct MAPPI
  *		Relay to get gid as defined during mounting
  */
 
-gid_t relay_find_group(const struct MAPPING *mapping __attribute__((unused)),
+gid_t relay_find_group(__attribute__((unused))const struct MAPPING *groupmapping,
 			const SID *gsid)
 {
 	int gid;
Index: ntfs-3g-2009.11.14/src/secaudit.h
===================================================================
--- ntfs-3g-2009.11.14.orig/src/secaudit.h
+++ ntfs-3g-2009.11.14/src/secaudit.h
@@ -711,7 +711,7 @@ void *chkmalloc(size_t, const char*, int
 void *chkcalloc(size_t, size_t, const char *, int);
 void chkfree(void*, const char*, int);
 BOOL chkisalloc(void*, const char*, int);
-void dumpalloc(const char*);
+void dumpalloc(const char *txt);
 
 #define malloc(sz) chkmalloc(sz, __FILE__, __LINE__)
 #define calloc(cnt,sz) chkcalloc(cnt, sz, __FILE__, __LINE__)
@@ -722,10 +722,10 @@ void dumpalloc(const char*);
 struct passwd *getpwnam(const char *user);
 struct group *getgrnam(const char *group);
 
-const SID *relay_find_usid(const struct MAPPING *usermapping,
-			uid_t uid, SID *pdefsid);
-const SID *relay_find_gsid(const struct MAPPING *groupmapping,
-			gid_t gid, SID *pdefsid);
-uid_t relay_find_user(const struct MAPPING *usermapping, const SID *usid);
-gid_t relay_find_group(const struct MAPPING *groupmapping, const SID * gsid);
+const SID *relay_find_usid(const struct MAPPING *usermapping __attribute__((unused)),
+			uid_t uid, SID *defusid);
+const SID *relay_find_gsid(const struct MAPPING *groupmapping __attribute__((unused)),
+			gid_t gid, SID *defgsid);
+uid_t relay_find_user(const struct MAPPING *usermapping __attribute__((unused)), const SID *usid);
+gid_t relay_find_group(const struct MAPPING *groupmapping __attribute__((unused)), const SID *gsid);
 
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to