Removal of genksyms warnings in make dep

Bjorn Ekwall (bj0rn@blox.se)
Tue, 14 May 1996 16:21:58 +0200 (MET DST)


Hi all!

Since Linus obviously thinks that he will be able to enjoy some German
beer while celebrating Linux-2.0, I thought it is about time we cleaned
up the warnings that genksyms generates on "make depend" for kernels
with CONFIG_MODVERSIONS enabled.

OK, they _are_ just warnings, but since genksyms attempts to expand
(recursively) the types for every exported symbol (both return value
and parameters) down to the basic types, it actually needs a few more
headers than what the normal compilation does.

The trick is to find _what_ extra files to include.

In linux-1.2 we had achieved the perfect state w.r.t. this, but it
has degenerated a little bit since then...

I can do some of the work if people that use "unusual" modules with
CONFIG_MODVERSIONS could send the outputs from "make depend" to me,
preferably edited so that only the name of the source files and the
name of the affected symbols are shown, together with the corresponding
"gcc ..."-line.
I need the directories of the sources as well, of course...

Since the 2.0-series is intended to be "stable", the benefits of
versioned modules will be easier to see, since the basic structs
and types probably won't change quite as much as they have been,
during the development phase in 1.3.*

As a last resort, we can remove the "-w" option to genksyms, but
that doesn't solve anything, it only hides the warnings...

Cheers,

Bjorn <bj0rn@blox.se>

P.S. If anyone wants to look at what is happening, do this:

1. Save the gcc line from "make depend" where the warnings appear.
Example:

gcc -D__KERNEL__ -I/u/100/linux/include -Wall -Wstrict-prototypes \
-O2 -fomit-frame-pointer -fno-strength-reduce -pipe -m486 -DCPU=486 \
-E -D__GENKSYMS__ ksyms.c

2. Paste that line into the following script
# Your gcc line here
| /sbin/genksyms -D -w /tmp | grep $1 | awk '
{ for (i = 1; i < NF; ++i) {
if ($i == "{") {
level = level + 1;
printf "%s\n", $i;
for (j = 0; j < level; ++j)
printf " "
}
else if ($i == "}") {
level = level - 1;
printf "\n"
for (j = 0; j < level; ++j)
printf " "
printf "%s ", $i;
}
else if ($i == ";") {
printf ";\n"
for (j = 0; j < level; ++j)
printf " "
}
else
printf "%s ", $i;
}
}' -

3. For every symbol in that sourcefile that has a warning, do this:
Example: for the 'do_mmap' warning from kernel/ksyms.c

The_script do_mmap > something_to_think_about