Subject: Re: kernel compilation using gcc 3.2.2 - supposed to work?
To: Jason Thorpe <thorpej@wasabisystems.com>
From: theo borm <theo4490@borm.org>
List: tech-kern
Date: 04/22/2003 17:42:51
Jason Thorpe wrote:

> The fact that you had to modify the kernel sources to compile with 
> 3.2.x is part of the problem ... GCC 3.3 has been modified to play 
> nice with some of the constructs used in the NetBSD kernel. 

Two of the three modifications were printf's with more arguments than
there were in the format specification, the third was a zero length format
specification. (see below for details).
I'm not sure what the functions do or why they should call printf with such
odd arguments. It makes me wonder whether the kernel sources should be
fixed rather than the compiler?

I look forward to 3.3 in a future release, but needed some of the 3-series
features right now. It was curiosity that prompted me to give the kernel
sources a try, and was pleasantly surprised. I have understood that others
have been successfully using 3.2.2 to (cross-) compile kernels for some
time now, and that it's user land that is giving (linking) trouble.

with kind regards,

Theo.



cc1: warnings being treated as errors

/sys/dev/ic/ld_icp.c: In function `ld_icp_attach':
/sys/dev/ic/ld_icp.c:128: warning: too many arguments for format
if (!icp_cmd(icp, ICP_CACHESERVICE, ICP_IOCTL, ICP_CACHE_DRV_INFO,
sc->sc_hwunit, sizeof(struct icp_cdevinfo))) {
printf(": unable to retrieve device info\n",
ld->sc_dv.dv_xname);

/sys/dev/ic/aac.c: In function `aac_describe_controller':
/sys/dev/ic/aac.c:364: warning: too many arguments for format
printf("%s: %s at %dMHz, %dMB cache, %s, kernel %d.%d-%d\n",
sc->sc_dv.dv_xname,
aac_describe_code(aac_cpu_variant, le32toh(info->CpuVariant)),
le32toh(info->ClockSpeed),
le32toh(info->BufferMem) / (1024 * 1024),
aac_describe_code(aac_battery_platform,
le32toh(info->batteryPlatform)),
le32toh(info->batteryPlatform),
info->KernelRevision.external.comp.major,
info->KernelRevision.external.comp.minor,
info->KernelRevision.external.comp.dash);

/sys/kern/subr_disk.c: In function `diskerr':
/sys/kern/subr_disk.c:348: warning: zero-length format string
if (pri != LOG_PRINTF) {
static const char fmt[] = "";
log(pri, fmt);
pr = addlog;
} else
pr = printf;