Compilation error in the afs/dir.c

Jan Marek (linux@hazard.jcu.cz)
Mon, 21 Oct 2002 15:07:35 +0200


Hallo lkml,

I have problem with compilation of fs/afs/dir.c:

gcc -Wp,-MD,fs/afs/.dir.o.d -D__KERNEL__ -Iinclude -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i686 -Iarch/i386/mach-generic -nostdinc -iwithprefix include
-DMODULE -include include/linux/modversions.h -DKBUILD_BASENAME=dir
-c -o fs/afs/dir.o fs/afs/dir.c
fs/afs/dir.c:75: warning: unnamed struct/union that defines no instances
fs/afs/dir.c: In function `afs_dir_iterate_block':
fs/afs/dir.c:261: union has no member named `name'
fs/afs/dir.c:293: union has no member named `name'
fs/afs/dir.c:296: union has no member named `vnode'
fs/afs/dir.c:296: union has no member named `vnode'
fs/afs/dir.c:296: union has no member named `vnode'
fs/afs/dir.c:297: union has no member named `unique'

Problem is here:

typedef union afs_dirent {
struct {
u8 valid;
u8 unused[1];
u16 hash_next;
u32 vnode;
u32 unique;
u8 name[16];
u8 overflow[4]; /* if any char of the name (inc
NUL) reaches here, consume
* the next dirent too */
};
u8 extended_name[32];
} afs_dirent_t;

but I don't know, if I can change this typedef to:

typedef struct afs_dirent {
u8 valid;
u8 unused[1];
u16 hash_next;
u32 vnode;
u32 unique;
u8 name[16];
u8 overflow[4]; /* if any char of the name (inc
NUL) reaches here, consume
* the next dirent too */
} afs_dirent_t;

(extended_name is not used in whole dir.c...)

But is here any better way?

Sincerely
Jan Marek

-- 
Ing. Jan Marek
University of South Bohemia
Academic Computer Centre
Phone: +420-38-7772080
-
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/