delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/30/01:02:56

Date: Thu, 30 May 2002 08:00:09 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Patches for building with gcc 3.1 - tests chunk
In-Reply-To: <E17D9GJ-0000Pk-00@phekda.freeserve.co.uk>
Message-ID: <Pine.SUN.3.91.1020530075412.11104C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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.

> * signals.c - is the typecasting valid?

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.

> -  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.

> -  urand = ((double)rand()) / RAND_MAX;
> +  urand = ((double)(long)rand()) / RAND_MAX;

I don't understand the need for this change.  What's wrong with the 
original code, exactly?

- Raw text -


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