Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2001 10:22:52 -0700 (PDT)
From:      "Dorr H. Clark" <dclark@applmath.scu.edu>
To:        freebsd-bugs@freebsd.org
Subject:   ansi bug in vm_mmap.c & nspvar.h - are there more of these?
Message-ID:  <Pine.GHP.4.21.0110161003380.5965-100000@hpux36.dc.engr.scu.edu>

next in thread | raw e-mail | index | archive | help

In sys/vm/vm_mmap.c the functions mmap(), munmap(), and madvise()
all have the same problem in release 4.4 and at the top version.

The problem is the code block of the form:

#ifndef i386
	if (VM_MIN_ADDRESS ... etc.
		return (EINVAL);
#endif

In the kernel compilations, -ansi is thrown in all 4.x 
releases.  One of the effects of -ansi is to suppress
the gcc ansi intrusion of the architecture compiler flags,
so for example the equivalent of -Di386 is not thrown
for kernel builds.

As a result, the three code blocks described above 
are actually ENABLED on all platforms.

There is an immediate question of what to do about 
these code blocks.  If the string i386 is converted 
to __i386__, the behavior will change on the x86
since the code inside the define will now be suppressed.

Another example of this problem is in sys/dev/nsp/nspvar.h
at the very bottom of the file.  The macro SOFT_INTR_REQUIRED 
is behind an #if defined(i386) which is suppressed in 
the kernel build because of -ansi.  This causes 
SOFT_INTR_REQUIRED to be defined into nothing on all 
architectures.

But I have a broader question:  if the -ansi flag is
withdrawn from the kernel builds, how many other
compilations will change, and what is the best way
for these to be found?  

Finally, should I fill out a bug report on this?

Thanks,

-Dorr H. Clark

School of Engineering
Santa Clara University



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GHP.4.21.0110161003380.5965-100000>