[Crash-utility] gcc 2.96 diskdump.c compile failure
Dave Anderson
anderson at redhat.com
Wed Nov 9 21:24:40 UTC 2005
Dave Anderson wrote:
>
> Castor's patch fixed a 2.x gcc compiler failure here because
> of the inadvertant double semi-colon:
>
> @@ -52,7 +52,7 @@
> kernel_init(int when)
> {
> int i;
> - char *p1, *p2, buf[BUFSIZE];;
> + char *p1, *p2, buf[BUFSIZE];
> struct syment *sp1, *sp2;
>
> ...which I wasn't aware of, since I haven't been testing builds with
> that era compiler for a some time now. But in doing so, I see that
> gcc 2.96 won't compile diskdump.c either:
>
> cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 diskdump.c
> In file included from diskdump.c:24:
> diskdump.h:49: array size missing in `tasks'
> make[3]: *** [diskdump.o] Error 1
>
> because of the tasks member at the end of this struct:
>
> struct disk_dump_header {
> char signature[SIG_LEN]; /* = "DISKDUMP" */
> int header_version; /* Dump header version */
> struct new_utsname utsname; /* copy of system_utsname */
> struct timeval timestamp; /* Time stamp */
> unsigned int status; /* Above flags */
> int block_size; /* Size of a block in byte */
> int sub_hdr_size; /* Size of arch dependent
> header in blocks */
> unsigned int bitmap_blocks; /* Size of Memory bitmap in
> block */
> unsigned int max_mapnr; /* = max_mapnr */
> unsigned int total_ram_blocks;/* Number of blocks should be
> written */
> unsigned int device_blocks; /* Number of total blocks in
> * the dump device */
> unsigned int written_blocks; /* Number of written blocks */
> unsigned int current_cpu; /* CPU# which handles dump */
> int nr_cpus; /* Number of CPUs */
> struct task_struct *tasks[];
> };
>
> Can this be changed to: struct task_struct **tasks;
> and get away with it?
or should it be:
struct task_struct *tasks[0];
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20051109/19a48bc9/attachment.htm>
More information about the Crash-utility
mailing list