Skip to contentSkip to conversation

make fs/reiser4/search.c compile with gcc 4.0

PATCH In review Grzegorz Jaśkiewicz 2 participants 4 messages Sep 22, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make fs/reiser4/search.c compile with gcc 4.0

Here's full message, this is linux 2.6.9-rc2-mm1
gcc -Wp,-MD,fs/reiser4/.search.o.d -nostdinc -iwithprefix include
-D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -fomit-frame-pointer -Wdeclaration-after-statement -pipe -msoft-float -mpreferred-stack-boundary=2 -fno-unit-at-a-time -march=pentium3 -Iinclude/asm-i386/mach-default -Wformat -Wundef -Wunused -Wcomment -Wno-nested-externs -Wno-write-strings -Wno-sign-compare
-Wuninitialized -DKBUILD_BASENAME=search -DKBUILD_MODNAME=reiser4 -c
-o fs/reiser4/.tmp_search.o fs/reiser4/search.c fs/reiser4/search.c: In function 'cbk_node_lookup':
fs/reiser4/search.c:1111: error: invalid storage class for function 'key_is_ld'

gcc --version
gcc (GCC) 4.0.0 20040922 (experimental)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I know gcc 4.0 is still in it's alphas.
Obvious solution is to move function declared in other function up-wards. Since it's static anyway, it won't make any diffrence. Please consider applying to repo.
Thanks.

-----

reiser4/search.new.c 2004-09-22 20:37:26 +0200 renamed from reiser4/search.c 2004-09-22 20:38:04 +0200 +14 -13
@@ -1088,6 +1088,20 @@
 }
 #endif
 
+/* true if @key is left delimiting key of @node */
+static int key_is_ld(znode * node, const reiser4_key * key) {
+       int ld;
+
+        assert("nikita-1716", node != NULL);
+        assert("nikita-1758", key != NULL);
+
+        RLOCK_DK(znode_get_tree(node));
+        assert("nikita-1759", znode_contains_key(node, key));
+        ld = keyeq(znode_get_ld_key(node), key);
+        RUNLOCK_DK(znode_get_tree(node));
+        return ld;
+}
+
 /* Process one node during tree traversal.
 
    This is called by cbk_level_lookup(). */
@@ -1107,19 +1121,6 @@
        /* result */
        int result;
 
-       /* true if @key is left delimiting key of @node */
-       static int key_is_ld(znode * node, const reiser4_key * key) {
-               int ld;
-
-                assert("nikita-1716", node != NULL);
-                assert("nikita-1758", key != NULL);
-
-                RLOCK_DK(znode_get_tree(node));
-                assert("nikita-1759", znode_contains_key(node, key));
-                ld = keyeq(znode_get_ld_key(node), key);
-                RUNLOCK_DK(znode_get_tree(node));
-                return ld;
-       }
        assert("nikita-379", h != NULL);
 
        active = h->active_lh->node;
Signature · 1 line
GJ
#1 lore raw
Quoted 4 lines · On Wed, 22 Sep 2004 20:45:55 +0200, =?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= said:

I know gcc 4.0 is still in it's alphas.
Obvious solution is to move function declared in other function up-wards. Since it's static anyway, it won't make any diffrence. Please consider applying to repo.

I'm not sure it's a good idea to be trying to "fix" reiser4 code to compile with an alpha compiler, at least without a *very* firm commitment from the gcc crew that this *is* a real error in the reiser4 code and not a bug in gcc causing a spurious message.

Why does this code compile cleanly with gcc 3.x and fail with a 4.0 alpha? Without knowing that, it's *STUPID* to change the code to suit the alpha...

#2 lore raw
Quoted 7 lines · On Wed, 22 Sep 2004 14:59:37 -0400, [email protected]…
Quoted 4 lines · On Wed, 22 Sep 2004 20:45:55 +0200, =?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= said:

I know gcc 4.0 is still in it's alphas.
Obvious solution is to move function declared in other function up-wards. Since it's static anyway, it won't make any diffrence. Please consider applying to repo.

Quoted 7 lines

I'm not sure it's a good idea to be trying to "fix" reiser4 code to compile with an alpha compiler, at least without a *very* firm commitment from the gcc crew that this *is* a real error in the reiser4 code and not a bug in gcc causing a spurious message.

Why does this code compile cleanly with gcc 3.x and fail with a 4.0 alpha? Without knowing that, it's *STUPID* to change the code to suit the alpha...

This code uses stuppid gcc extension, that is not present in gcc 4.0. There is no reason to keep it that way in sources, at least I didn't found any. Function is static anyway, so symbos are not going to be exported. The fact that gcc 4.0 is not compiling it, is just another excuse to move it. There is at least one more that kinda bug in kernel.

Signature · 1 line
GJ
#3 lore raw
Quoted 1 line · On Wed, 22 Sep 2004 21:03:45 +0200, =?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= said:

This code uses stuppid gcc extension, that is not present in gcc 4.0.

OK, if it's using a GCC extension that's already officially deprecated in 3.X and will be removed in 4.0, then that *is* a good reason to fix the code.