delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/06/08/10:34:06

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3D020C33.E455B6D6@phekda.freeserve.co.uk>
Date: Sat, 08 Jun 2002 14:52:51 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Patches for building with gcc 3.1 - tests chunk
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1020530075412 DOT 11104C-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> 
> On Wed, 29 May 2002, Richard Dawe wrote:
> 
> > Here's the chunk of the patch for building DJGPP's tests with gcc 3.1.
> 
> Thanks!  Some comments below.
> 
> > * stdarg.c - need to decide what to about __dj_va_rounded_size;
> 
> We could do several things:
> 
>   - have __dj_va_rounded_size defined in stdarg.h even for GCC 3.x and
>     later (the definition will never hurt anything);
> 
>   - define it in stdarg.c;
> 
>   - or use its definition directly in the code of stdarg.c.

I don't like the first idea. What if programs have things conditional on
__dj_va_rounded_size? It seems unlikely, I admit. But I don't think we should
define anything from DJGPP's va_list handling, when we're using GCC's built-in
va_list handling.

I prefer copying the definition from <stdarg.h> to stdarg.c. I'll do that, in
my next patch.

[snip]
> See below.
> 
> > +      res = system ("djecho"
> > +"            William Safire's Rules for Writers:"
> > +""
> > +"Remember to never split an infinitive. The passive voice should never be used."
> 
> It is IMHO better to leave the original text as a single string, and
> instead add \n\ at the end of each line.

OK.

BTW system2.c seems broken anyway. In my work area that has no gcc 3.1 patches
I get a 'mismatched quote', when I run the test under bash. A simple fix is to
quote the text and escape the single quotes.

> > -  printf("bss scan from %p to %p, %lu bytes\n", c, e, e-c);
> > +  printf("bss scan from %p to %p, %d bytes\n", c, e, (ptrdiff_t) (e-c));
> 
> I'd suggest to leave %lu and cast e-c to size_t.  Since we _know_ both e
> and c belong to the same object, e-c is really its size, not a difference
> between two arbitrary pointers.
[snip]

I disagree, since they *are* pointers. Casting to a size_t seems like adding
an unnecessary assumption to me. (The assumption is that e > c.)

I'll commit the changes to the other tests, that no-one has commented on:
tscanf.c, tsnprntf.c, tsnprntf2.c. I think they're uncontroversial. They are
to fix format strings to unsigned for displaying strlen()'s return value and a
stub for _doprnt() that should use a va_list in its declaration.

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019