Hi again,

Dominique Leuenberger a.k.a DimStar wrote:
Quoting Jean-Pierre André <[email protected]>:

Hi again Dominique,

Dominique Leuenberger a.k.a DimStar wrote:

Probably what you did for your tests was just recompile the file, but not re-run configure with -Werror as flags. Then of course, config.h does not have #define const inside and you do not run into the same issue.

True. I was not suspecting the configure procedure.

The link I posted previously actually mentiones that autoconf 2.60 should have it solved. Nevertheless even when using autoconf 2.63 (I tried to reconf, then recreate a tarball) this error seemed not to be really fixed.

So what I did now to solve the issue for the opensuse package is to add
sed -i "/#define const/d" config.h
between the configure and the make calls. this is the easiest way around this specific bug (patching out AC_C_CONST out of configure.ac would be an option, but then I run again in the issue that autogen.sh does not complete in my chroot... and I do not want to fiddle that out :) ).

The problem with this, is that the fix is within
your development script. A user doing a standard
configure/make will fall into the same trap.
I would rather undefine const in the source code,
but that may be a matter of taste.

So now with this config.h patched (trusting that building the package for openSUSE will always have const properly available by the compiler) I end up with the attached patch that is still needed in order to pass the build.

It would be gighly appreciated if this patch could be reviewed and applied to the code base for future releases (I do not like to carry patches forever in my packages).

In the meantime, I had made modifications to usermap.c
for shutting down the warnings about unused arguments.
However I do not want to use __attribute__ because I
cannot use it on Windows (this tool is designed for both
Linux and Windows). Moreover in one instance, this should
be conditional. Attached is the diff to the next version.

Regards

Jean-Pierre

Thanks everybody for your time on for helping solve this issue! Was an 'interesting' one.

Dominique

--- src/usermap.c       2009-10-04 03:50:28.000000000 +0200
+++ /shared/c-src/acls/usermap.c        2009-11-28 10:16:37.000000000 +0100
@@ -39,6 +39,9 @@
  *
  *  May 2009 Version 1.1.2
  *     - avoided selecting DOS names on Linux
+ *
+ *  Nov 2009 Version 1.1.3
+ *     - shutdown compiler warnings for unused parameters
  */
 
 /*
@@ -67,8 +70,8 @@
 #else
 #define USESTUBS 0 /* direct calls to API, based on following definitions */
 #define ENVNTFS3G "NTFS3G"
-#define LIBFILE64 "/lib64/libntfs-3g.so.4921"
-#define LIBFILE "/lib/libntfs-3g.so.4921"
+#define LIBFILE64 "/lib64/libntfs-3g.so.491"
+#define LIBFILE "/lib/libntfs-3g.so.491"
 #endif
 
 #define GET_FILE_SECURITY "ntfs_get_file_security"
@@ -77,7 +80,7 @@
 #define INIT_FILE_SECURITY "ntfs_initialize_file_security"
 #define LEAVE_FILE_SECURITY "ntfs_leave_file_security"
 
-#define VERSION "1.1.2"
+#define VERSION "1.1.3"
 #define MAPDIR ".NTFS-3G"
 #define MAPFILE "UserMapping"
 #define MAXATTRSZ 2048
@@ -215,6 +218,15 @@
 void *ntfs_context = (void*)NULL;
 
 /*
+ *             Shut down compiler warnings for unused parameters
+ */
+
+static long unused(const void *p)
+{
+return ((long)p);
+}
+
+/*
  *             Open and close the security API (platform dependent)
  */
 
@@ -715,6 +727,9 @@
        char *accname;
        char *name;
 
+       unused((void*)&pos);
+       unused((void*)&mft_ref);
+       unused((void*)&dt_type);
        fullname = (char *)malloc(strlen(context->dir)
                         + utf8_size(ntfsname, length) + 2);
        if (fullname) {
@@ -1249,6 +1264,8 @@
                fprintf(stderr, "    the Windows system partition should be 
named first\n");
        }
 #else
+       unused((void*)argv);
+       unused((void*)&silent);
        err = (argc < 2);
        if (err) {
                fprintf(stderr, "Usage : usermap dev1 [dev2 ...]\n");
------------------------------------------------------------------------------
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