Alan Barrett | 2 Oct 20:06 2006

Adding a "make regress" target

Does it make sense to add a "regress" target to src/foo/bar/Makefile
that runs the regression tests from src/regress/foo/bar?  Perhaps
it could be generalised to some magic in share/mk/*, but the
non-generalised version looks like this:

Index: src/bin/ps/Makefile
--- Makefile	19 Jun 2002 08:11:55 -0000	1.28
+++ Makefile	2 Oct 2006 18:01:15 -0000
 <at>  <at>  -8,4 +8,9  <at>  <at> 

 CWARNFLAGS+=	-Wno-format-y2k

+TEST_PS?=	${.OBJDIR}/ps
+regress:
+	cd ${.CURDIR}/../../regress/bin/ps \
+	&& TEST_PS=${TEST_PS:Q} ${MAKE} regress
+
 .include <bsd.prog.mk>

--apb (Alan Barrett)

Izumi Tsutsui | 11 Oct 18:20 2006
Picon

pulling kernel headers on building hostprogs

Hi,

There is a report that making NetBSD-3.0 images in -current
src/distrib/cdrom/macppc_installboot dir fails on NetBSD-3.0 host.

The problem is that the Makefile has "-I${NETBSDSRCDIR}/sys"
for CPPFLAGS to pull <fs/cd9660/iso.h> and <fs/locale.h> but
it causes a problem that usual system headers like <sys/stat.h>
are also pulled from ${NETBSDSRCDIR}/sys dir, not /usr/include/sys
for the host.

I think we could avoid this by copying required headers into
${.OBJDIR} or somewhere else like src/tools/Makefile.disklabel does,
and the attached patch may fix the problem, but I'd like to ask
toolchain people if there is more appropriate way to handle
these issue.

(ideally cd9660 support should be merged into installboot(8)??)
---
Izumi Tsutsui

Index: Makefile
===================================================================
RCS file: /cvsroot/src/distrib/cdrom/macppc_installboot/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile	17 Sep 2006 03:56:03 -0000	1.6
+++ Makefile	11 Oct 2006 14:47:52 -0000
 <at>  <at>  -4,7 +4,21  <at>  <at> 
 SRCS=		installboot.c cd9660.c cd9660_util.c
(Continue reading)

Valeriy E. Ushakov | 13 Oct 00:48 2006
Picon

__unused function args

__unused function args have some problems with macros and cpp
conditionals, b/c we don't know if given macro actualy uses the
argument (e.g. on other platforms), and different #if branches may use
different set of arguments.

We need something like plan9 USED(x), so that macros and #if branches
can "consume" args.

One option is

#define USED(x) do { (void)&x; } while (0)

But that needs a lint stub to avoid " warning: expression has null
effect".

Another option, that is lint-happy as-is, is

#define USED(x) do { if (&x) {} } while (/* CONSTCOND */ 0)

The nit-pick is that & doesn't work with arguments declared
"register", but "register" args are so 1980s, that I think we don't
care :).  The benefit of & is that it takes care about struct args.

Ideally, USED should aslo ensure that its argument is a plain
variable, or at least make sure it doesn't evaluate its argument.

#define USED(x) do { if (sizeof(x)) {} } while (0)

seems to keep gcc happy w.r.t. x being "used" by sizeof(), but lint
doesn't seem to believe in this kind of usage.
(Continue reading)

Krister Walfridsson | 14 Oct 12:11 2006
Picon
Picon
Picon

Re: __unused function args


On Fri, 13 Oct 2006, Valeriy E. Ushakov wrote:

> __unused function args have some problems with macros and cpp
> conditionals, b/c we don't know if given macro actualy uses the
> argument (e.g. on other platforms), and different #if branches may use
> different set of arguments.
>
> We need something like plan9 USED(x), so that macros and #if branches
> can "consume" args.

Is this a big problem?  The gcc __attribute__((__unused__)) means
that "the variable is meant to be possibly unused", so it is not
wrong to set this attribute for arguments that actually are used.
(It does of course have the problem of developers forgetting to
remove the __unused when the code do not need it any longer, but
I'd guess the same could happen with the USED() macro too...)

But I find the warning silly anyway, so I'd prefer to use 
-Wno-unused-parameter...

    /Krister

matthew green | 14 Oct 23:14 2006
Picon

re: __unused function args


   But I find the warning silly anyway, so I'd prefer to use 
   -Wno-unused-parameter...

i agree.  i think we shuold back out everything else and use this.

Christos Zoulas | 14 Oct 23:19 2006

Re: __unused function args

In article <14666.1160860484 <at> splode.eterna.com.au>,
matthew green  <mrg <at> eterna.com.au> wrote:
>   
>   But I find the warning silly anyway, so I'd prefer to use 
>   -Wno-unused-parameter...
>
>
>i agree.  i think we shuold back out everything else and use this.

It is really easy to do [back out the changes] with sed -e 's/ __unused//g'.
This way we will not lose the ansi prototyping changes. I am not sure if we
want to do it though.

christos

matthew green | 14 Oct 23:26 2006
Picon

re: __unused function args


   In article <14666.1160860484 <at> splode.eterna.com.au>,
   matthew green  <mrg <at> eterna.com.au> wrote:
   >   
   >   But I find the warning silly anyway, so I'd prefer to use 
   >   -Wno-unused-parameter...
   >
   >
   >i agree.  i think we shuold back out everything else and use this.

   It is really easy to do [back out the changes] with sed -e 's/ __unused//g'.
   This way we will not lose the ansi prototyping changes. I am not sure if we
   want to do it though.

sure.

.mrg.

YAMAMOTO Takashi | 17 Oct 10:57 2006
Picon

Re: CVS commit: src/sys

> Module Name:	src
> Committed By:	dogcow
> Date:		Fri Oct 13 16:53:36 UTC 2006
> 
> Modified Files:
> 	src/sys/arch/i386/i386: vm_machdep.c
> 	src/sys/dev/mca: esp_mca.c
> 	src/sys/dev/wscons: wsdisplay.c wskbd.c
> 	src/sys/dist/ipf/netinet: ip_fil_netbsd.c ip_lookup.c ip_nat.c
> 	    ip_state.c
> 	src/sys/kern: kern_exec.c kern_ktrace.c kern_ntptime.c kern_subr.c
> 	    sys_generic.c
> 	src/sys/net: if_bridge.c if_spppsubr.c
> 
> Log Message:
> More -Wunused fallout. sprinkle __unused when possible; otherwise, use the
> 	do { if (&x) {} } while (/* CONSTCOND */ 0);
> construct as suggested by uwe in <20061012224845.GA9449 <at> snark.ptc.spbu.ru>.

what's the point of these do-while?
i can understand if it were a macro as uwe's suggestion, but...

YAMAMOTO Takashi

Tom Spindler | 17 Oct 20:24 2006

Re: CVS commit: src/sys

> what's the point of these do-while?

Now that -Wno-unused-parameter is in place, I've backed all of these out.

Valeriy E. Ushakov | 20 Oct 04:36 2006
Picon

gdb6 mknative vs readline

I wonder how people have bootstrapped gdb6 for the platforms that have
been switched.  I'm trying to switch sh3 and do what README.mknative
tells me.  During nbmake-MACHINE native-gdb step I get:

In file included from /usr/src/tools/gdb/../../gnu/dist/gdb6/gdb/cli/cli-cmds.c:25:
/usr/src/tools/gdb/../../gnu/dist/gdb6/gdb/../readline/../readline/tilde.h:68: error:
conflicting types for 'tilde_expand'
/usr/nb/distrib/hpcsh/usr/include/readline/readline.h:155: error: previous declaration of
'tilde_expand' was here

What happens is that gdb6 assumes a new readline, so some files under
gdb/cli inlcude readline/tilde.h - which our libedit doesn't have.

So b/c of

    -I/usr/nb/distrib/hpcsh/usr/include
    -I/usr/src/tools/gdb/../../gnu/dist/gdb6/gdb/../readline/..

it picks up out readline.h but tilde.h for the readline that comes
with gdb.

The prototype for tilde_expand has been deconstified as a fix to
bin/30500 - thus exposing the problem above.  (readline 4.1 and before
have tilde_expand with non-const argument, but 4.2 changed to const).

I think 30500 should be refixed to make our tilde_expand const again,
and changing gdb53 prototype in defs.h instead.

We should also decide what to do with gdb6 vs readline.  Shall we just
bit the bulled and compile it with the GNU readline it comes with?  Or
(Continue reading)


Gmane