[sane-devel] Compilation error on Compaq Tru64

Henning Meier-Geinitz henning@meier-geinitz.de
Wed, 20 Nov 2002 15:08:50 +0100


Hi,

On Wed, Nov 20, 2002 at 12:06:55AM +0000, Major A wrote:
> > Oops. That would be me who is responsible for ab306.c. On the other
> > hand on first sight it maybe an error in the header (?), as I don't
> > see any suspicious changes between SANE 1.0.1 (oldest version in CVS)
> > and now. And I'm sure I ran 2.0.x at that time.
> 
> 1.0.2 was successfully installed on the very same machine, everything
> else has remained the same since, including kernel, headers,
> libraries, gcc, binutils.

Ok. I've never tested on Linux/sparc. sanei_ab306.c doesn't seem to be
the reason for the bug because the dif to 1.0.2 shows only the
addition of FreeBSD and some signedness changes. But maybe a change in
config.h is missing a header now?

> > If you have too much time you can have a look at
> > /usr/include/asm/system.h:140 and find out why there is an
> > unterminated string.
> 
> I always have too much time :-(
> 
> The lines it complains about are of the form
> 
>         __asm__ __volatile__("

Maybe it doesn't like the string concatenation: "fdsfsdf" \
"fdsfdsfds" \
"fsdfsfsdf" \

> If I omit the -pedantic flag to gcc, it no longer complains about
> this, but about
> 
> /usr/include/asm/io.h:107: `sparc_cpu_model' undeclared (first use this function)
>
> This is what a grep gives:
> 
> /usr/include/asm/auxio.h:       switch(sparc_cpu_model) { \
> /usr/include/asm/floppy.h:      if((sparc_cpu_model != sun4c && sparc_cpu_model != sun4m) ||
> /usr/include/asm/floppy.h:      if(sparc_cpu_model == sun4m) {
> /usr/include/asm/floppy.h:        if(sparc_cpu_model == sun4c) {
> /usr/include/asm/io.h:  switch(sparc_cpu_model) {
> /usr/include/asm/io.h:          printk("mapioaddr: sparc_cpu_model = %d\n", sparc_cpu_model);
> /usr/include/asm/io.h:  switch(sparc_cpu_model) {
> /usr/include/asm/io.h:          printk("unmapioaddr: sparc_cpu_model = %d, halt...\n", sparc_cpu_model);
> /usr/include/asm/pgtable.h:     switch (sparc_cpu_model){
> /usr/include/asm/pgtable.h:     switch (sparc_cpu_model){
> /usr/include/asm/system.h:extern enum sparc_cpu sparc_cpu_model;
> /usr/include/asm/system.h:#define ARCH_SUN4C_SUN4 (sparc_cpu_model==sun4c)
> 
> Any ideas?

Sorry, not really. Anyway, the Debian bugtracking systems shows that
there have been (different) errors with this file on Linux/sparc even
with later versions of the kernel. So I guess it's a sparc-specific
kernel bug. Or we are not including a necessary header file.

On the other hand, there is already a check in configure.in, that
should disable asm/io.h if it can't be compiled. Ah, I see: asm/io.h
is included by sys/io.h, so the test isn't effective in this case. We
could also check if including/compiling sys/io.h works but I guess if
linux 2.0/sparc is the only platform with this problem we can ignore it.

Since we use autoconf 2.5, autoconf itself emits a warning if the
header is there but can't be compiled. But that's not in sane 1.0.9.

Bye,
  Henning