reiser4progs compiling with GCC4.0
PATCH 1/1 reiser4progs compiling with GCC4.0
Hi people,
I searched a bit on the mail archive and I didn't find anything about that except about the devel gcc4.0 tree.
With stable gcc4.0 reiser4progs fails to compile because of three "static declarations that follows a non-static declarations". I so made the following patch to get it compiling, but I would like to know if it seems correct to you (and if it has not already be done ;-) ) before I integrate it in the Source Mage grimoire.
diff -uNr reiser4progs-1.0.4/plugin/key/key_large/key_large.h reiser4progs-1.0.4.new/plugin/key/key_large/key_large.h --- reiser4progs-1.0.4/plugin/key/key_large/key_large.h 2005-02-01 20:08:05.000000000 +0100
+++ reiser4progs-1.0.4.new/plugin/key/key_large/key_large.h
2005-05-26 16:57:20.000000000 +0200
@@ -43,7 +43,7 @@
typedef union key_large key_large_t;
-extern reiser4_plug_t key_large_plug;
+static reiser4_plug_t key_large_plug;
typedef enum {
/* Major locality occupies higher 60 bits of the first element*/
diff -uNr reiser4progs-1.0.4/plugin/key/key_short/key_short.h reiser4progs-1.0.4.new/plugin/key/key_short/key_short.h --- reiser4progs-1.0.4/plugin/key/key_short/key_short.h 2005-02-01 16:22:18.000000000 +0100
+++ reiser4progs-1.0.4.new/plugin/key/key_short/key_short.h
2005-05-26 16:57:20.000000000 +0200
@@ -42,7 +42,7 @@
typedef union key_short key_short_t;
-extern reiser4_plug_t key_short_plug;
+static reiser4_plug_t key_short_plug;
typedef enum {
/* Major locality occupies higher 60 bits of the first element*/
diff -uNr reiser4progs-1.0.4/plugin/oid/oid40/oid40.h reiser4progs-1.0.4.new/plugin/oid/oid40/oid40.h --- reiser4progs-1.0.4/plugin/oid/oid40/oid40.h 2005-01-17 14:13:49.000000000 +0100
+++ reiser4progs-1.0.4.new/plugin/oid/oid40/oid40.h 2005-05-26
16:57:20.000000000 +0200
@@ -30,7 +30,7 @@
typedef struct oid40 oid40_t;
-extern reiser4_plug_t oid40_plug;
+static reiser4_plug_t oid40_plug;
#define oid40_get_next(area) LE64_TO_CPU(*((d64_t *)area))
#define oid40_set_next(area, val) (*((d64_t *)area) =CPU_TO_LE64(val))
Thanks in advance. :-)
Signature · 6 lines
-- -- -- -- -- -- -- Flavien Bridault Source Mage GNU/Linux - Disk Section Guru irc: vlaaad jabber: [email protected]
В сообщении от Четверг 26 Май 2005 23:36 Flavien Bridault написал(a):
Quoted 10 lines
Hi people,
I searched a bit on the mail archive and I didn't find anything about that except about the devel gcc4.0 tree.
With stable gcc4.0 reiser4progs fails to compile because of three "static declarations that follows a non-static declarations". I so made the following patch to get it compiling, but I would like to know if it seems correct to you (and if it has not already be done ;-) ) before I integrate it in the Source Mage grimoire.
thank you for the report. your patch creates different static variables in each c file that includes the header. please try the attached patch.
-- Vitaly
===== plugin/key/key_large/key_large.c 1.44 vs edited =====
plugin/key/key_large/key_large.c +3 -1
@@ -6,6 +6,8 @@#ifdef ENABLE_LARGE_KEYS #include "key_large.h" +extern reiser4_plug_t key_large_plug; +/* Returns minimal key */ static reiser4_key_t *key_large_minimal (void ) {return key_common_minimal (&key_large_plug);
@@ -382,7 +384,7 @@ .get_name = key_large_get_name }; -static reiser4_plug_t key_large_plug = { +reiser4_plug_t key_large_plug = { .cl = class_init, .id = {KEY_LARGE_ID ,0 ,KEY_PLUG_TYPE }, #ifndef ENABLE_MINIMAL
===== plugin/key/key_large/key_large.h 1.14 vs edited =====
plugin/key/key_large/key_large.h +0 -2
@@ -43,8 +43,6 @@typedef union key_large key_large_t ; -extern reiser4_plug_t key_large_plug; - typedef enum { /* Major locality occupies higher 60 bits of the first element */ KEY_LARGE_LOCALITY_MASK = 0xfffffffffffffff0ull,
===== plugin/key/key_short/key_short.c 1.144 vs edited =====
plugin/key/key_short/key_short.c +3 -1
@@ -6,6 +6,8 @@#ifdef ENABLE_SHORT_KEYS #include "key_short.h" +extern reiser4_plug_t key_short_plug; +/* Returns minimal key */ static reiser4_key_t *key_short_minimal (void ) {return key_common_minimal (&key_short_plug);
@@ -367,7 +369,7 @@ .get_name = key_short_get_name }; -static reiser4_plug_t key_short_plug = { +reiser4_plug_t key_short_plug = { .cl = class_init, .id = {KEY_SHORT_ID ,0 ,KEY_PLUG_TYPE }, #ifndef ENABLE_MINIMAL
===== plugin/key/key_short/key_short.h 1.48 vs edited =====
plugin/key/key_short/key_short.h +0 -2
@@ -42,8 +42,6 @@typedef union key_short key_short_t ; -extern reiser4_plug_t key_short_plug; - typedef enum { /* Major locality occupies higher 60 bits of the first element */ KEY_SHORT_LOCALITY_MASK = 0xfffffffffffffff0ull,
===== plugin/oid/oid40/oid40.c 1.99 vs edited =====
plugin/oid/oid40/oid40.c +3 -1
@@ -8,6 +8,8 @@#include "oid40.h" #include "oid40_repair.h" +extern reiser4_plug_t oid40_plug; +static uint32_t oid40_get_state (generic_entity_t *entity) {aal_assert ("umka-2088" , entity !=NULL );return ((oid40_t *)entity)->state;
@@ -201,7 +203,7 @@ .slink_locality = oid40_slink_locality }; -static reiser4_plug_t oid40_plug = { +reiser4_plug_t oid40_plug = { .cl = class_init, .id = {OID_REISER40_ID ,0 ,OID_PLUG_TYPE }, .label ="oid40" ,
===== plugin/oid/oid40/oid40.h 1.39 vs edited =====
plugin/oid/oid40/oid40.h +0 -2
@@ -30,8 +30,6 @@typedef struct oid40 oid40_t ; -extern reiser4_plug_t oid40_plug; -#define oid40_get_next (area) LE64_TO_CPU(*((d64_t *)area))#define oid40_set_next (area, val) (*((d64_t *)area) = CPU_TO_LE64(val))
Quoted 12 lines · Vitaly
В сообщении от Четверг 26 Май 2005 23:36 Flavien Bridault написал(a):
Quoted 10 lines
Hi people,
I searched a bit on the mail archive and I didn't find anything about that except about the devel gcc4.0 tree.
With stable gcc4.0 reiser4progs fails to compile because of three "static declarations that follows a non-static declarations". I so made the following patch to get it compiling, but I would like to know if it seems correct to you (and if it has not already be done ;-) ) before I integrate it in the Source Mage grimoire.
Quoted 4 lines
thank you for the report. your patch creates different static variables in each c file that includes the header. please try the attached patch.
-- Vitaly
I did the previous one without knowing what should be the visibility of these variables, so your solution is indeed much better. :-) And that compiles like a charm with gcc4.0. :-)
I will integrate it in Source Mage spell. Can we expect that this fix will be included in next reiser4progs release ?
Thanks !
Signature · 6 lines
-- -- -- -- -- -- -- Flavien Bridault Source Mage GNU/Linux - Disk Section Guru irc: vlaaad jabber: [email protected]
В сообщении от Пятница 27 Май 2005 19:07 Flavien Bridault написал(a):
Quoted 16 lines · Vitaly
Quoted 15 lines
В сообщении от Четверг 26 Май 2005 23:36 Flavien Bridault написал(a):
Quoted 10 lines
Hi people,
I searched a bit on the mail archive and I didn't find anything about that except about the devel gcc4.0 tree.
With stable gcc4.0 reiser4progs fails to compile because of three "static declarations that follows a non-static declarations". I so made the following patch to get it compiling, but I would like to know if it seems correct to you (and if it has not already be done ;-) ) before I integrate it in the Source Mage grimoire.
thank you for the report. your patch creates different static variables in each c file that includes the header. please try the attached patch.
Quoted 7 lines
Quoted 1 line
-- Vitaly
I did the previous one without knowing what should be the visibility of these variables, so your solution is indeed much better. :-) And that compiles like a charm with gcc4.0. :-)
I will integrate it in Source Mage spell. Can we expect that this fix will be included in next reiser4progs release ?
sure, it will.
Quoted 1 line
Thanks !
-- Vitaly