On Tuesday October 21st 2003 at 15:52 uur Marco Roeland wrote: > > http://marc.theaimsgroup.com/?l=linux-kernel&m=106651554401143&w=2 > > > > It's supposed to fix test8 compile with gcc-2.96 for RedHat 7.x. > > Perhaps if the huge sprintf with 40+ arguments (fs/proc/array.c, line 346) > amongst which several trinary operators, were to be split up into several > parts, might that not solve the problem more elegantly? Does this compile (and work) for any of you friendly RedHat 7.[23] users? In 2.6.0-test8 yet another argument was added to the monstrous sprintf. Perhaps this was just the droplet to overflow gcc-2.96's buckets? Here we split it into 3 distinct parts. --- linux-2.6.0-test8/fs/proc/array.c.orig 2003-10-21 16:18:40.000000000 +0200 +++ linux-2.6.0-test8/fs/proc/array.c 2003-10-21 16:24:42.000000000 +0200 @@ -343,9 +343,7 @@ read_lock(&tasklist_lock); ppid = task->pid ? task->real_parent->pid : 0; read_unlock(&tasklist_lock); - res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \ -%lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu \ -%lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n", + res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu ", task->pid, task->comm, state, @@ -355,7 +353,8 @@ tty_nr, tty_pgrp, task->flags, - task->min_flt, + task->min_flt); + res += sprintf(buffer + res,"%lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu ", task->cmin_flt, task->maj_flt, task->cmaj_flt, @@ -375,7 +374,8 @@ mm ? mm->start_code : 0, mm ? mm->end_code : 0, mm ? mm->start_stack : 0, - esp, + esp); + res += sprintf(buffer + res,"%lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n", eip, /* The signal information here is obsolete. * It must be decimal for Linux 2.0 compatibility. -