linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Compilation error in ntfs driver
@ 2001-08-19 22:42 Joachim Herb
  2001-08-19 23:04 ` Anton Altaparmakov
  0 siblings, 1 reply; 2+ messages in thread
From: Joachim Herb @ 2001-08-19 22:42 UTC (permalink / raw)
  To: linux-kernel

Hello, 

I think I have found a compilation error in the ntfs driver in file
unistr.c:
make -C ntfs modules
make[2]: Entering directory `/usr/src/linux-2.4.7/fs/ntfs'
gcc -D__KERNEL__ -I/usr/src/linux-2.4.7/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=athlon  -DMODULE -DNTFS_VERSION=\"1.1.16\"   -c -o
unistr.o unistr.c
unistr.c: In function `ntfs_collate_names':
unistr.c:99: warning: implicit declaration of function `min'
unistr.c:99: parse error before `unsigned'
unistr.c:99: parse error before `)'
unistr.c:97: warning: `c1' might be used uninitialized in this function
unistr.c: At top level:
unistr.c:118: parse error before `if'
unistr.c:123: warning: type defaults to `int' in declaration of `c1'
unistr.c:123: `name1' undeclared here (not in a function)
unistr.c:123: warning: data definition has no type or storage class
unistr.c:124: parse error before `if'

The problem is the following part of the 2.4.9 patch:
diff -u --recursive --new-file v2.4.8/linux/fs/ntfs/unistr.c
linux/fs/ntfs/unistr.c
--- v2.4.8/linux/fs/ntfs/unistr.c       Wed Jul 25 17:10:24 2001
+++ linux/fs/ntfs/unistr.c      Wed Aug 15 01:22:17 2001
@@ -96,7 +96,7 @@
        __u32 cnt;
        wchar_t c1, c2;
 
-       for (cnt = 0; cnt < min(name1_len, name2_len); ++cnt)
+       for (cnt = 0; cnt < min(unsigned int, name1_len, name2_len);
++cnt)
        {
                c1 = le16_to_cpu(*name1++);
                c2 = le16_to_cpu(*name2++);

Simply remove it again, i.e. remove the "unsigned int, ", and the file
compiles (with one warning).

Joachim
-- 
Joachim Herb
mailto:herb@leo.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Compilation error in ntfs driver
  2001-08-19 22:42 Compilation error in ntfs driver Joachim Herb
@ 2001-08-19 23:04 ` Anton Altaparmakov
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Altaparmakov @ 2001-08-19 23:04 UTC (permalink / raw)
  To: Joachim Herb; +Cc: linux-kernel

Hello,

Yes, known problem, but wrong fix. Correct fix is to add the line:

#include <linux/kernel.h>

to the includes in fs/ntfs/unistr.c

Best regards,

Anton

At 23:42 19/08/01, Joachim Herb wrote:
>Hello,
>
>I think I have found a compilation error in the ntfs driver in file
>unistr.c:
>make -C ntfs modules
>make[2]: Entering directory `/usr/src/linux-2.4.7/fs/ntfs'
>gcc -D__KERNEL__ -I/usr/src/linux-2.4.7/include -Wall
>-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
>-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
>-march=athlon  -DMODULE -DNTFS_VERSION=\"1.1.16\"   -c -o
>unistr.o unistr.c
>unistr.c: In function `ntfs_collate_names':
>unistr.c:99: warning: implicit declaration of function `min'
>unistr.c:99: parse error before `unsigned'
>unistr.c:99: parse error before `)'
>unistr.c:97: warning: `c1' might be used uninitialized in this function
>unistr.c: At top level:
>unistr.c:118: parse error before `if'
>unistr.c:123: warning: type defaults to `int' in declaration of `c1'
>unistr.c:123: `name1' undeclared here (not in a function)
>unistr.c:123: warning: data definition has no type or storage class
>unistr.c:124: parse error before `if'
>
>The problem is the following part of the 2.4.9 patch:
>diff -u --recursive --new-file v2.4.8/linux/fs/ntfs/unistr.c
>linux/fs/ntfs/unistr.c
>--- v2.4.8/linux/fs/ntfs/unistr.c       Wed Jul 25 17:10:24 2001
>+++ linux/fs/ntfs/unistr.c      Wed Aug 15 01:22:17 2001
>@@ -96,7 +96,7 @@
>         __u32 cnt;
>         wchar_t c1, c2;
>
>-       for (cnt = 0; cnt < min(name1_len, name2_len); ++cnt)
>+       for (cnt = 0; cnt < min(unsigned int, name1_len, name2_len);
>++cnt)
>         {
>                 c1 = le16_to_cpu(*name1++);
>                 c2 = le16_to_cpu(*name2++);
>
>Simply remove it again, i.e. remove the "unsigned int, ", and the file
>compiles (with one warning).
>
>Joachim
>--
>Joachim Herb
>mailto:herb@leo.org
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

-- 
   "Nothing succeeds like success." - Alexandre Dumas
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-19 23:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-19 22:42 Compilation error in ntfs driver Joachim Herb
2001-08-19 23:04 ` Anton Altaparmakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).