delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/28/08:31:13

From: pavenis AT lanet DOT lv
To: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>, djgpp-workers AT delorie DOT com
Date: Tue, 28 May 2002 15:14:42 +0300
MIME-Version: 1.0
Subject: Re: GCC 3.1 & CVS LIBC emu387.cc patch (fatal error)
Message-ID: <3CF39EE2.19391.B8586B@localhost>
In-reply-to: <007401c20630$0c097b20$0102a8c0@acceleron>
X-mailer: Pegasus Mail for Windows (v4.01)
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 28 May 2002 at 19:58, Andrew Cottrell wrote:

> All,
> 
> Below is a patch that I've used in order to build DJGPP CVS LIBEMU.A with
> gcc 3.1. Any problems with this?
> 
> @@ -143,12 +141,9 @@ static inline int is_zero(reg a)
>  #ifndef eprintf
>  static void eprintf(const char *f, ...)
>  {
> -  va_list args;
>    char buf[1000];
> -  va_start(args, f);
> -  vsprintf(buf, f, args);
> +  vsprintf(buf, f, (char *)(&f)+1);
>    _write(1, buf, strlen(buf));
> -  va_end(args);
>  }
>  #endif
> 

2 small comments:

Perhaps it's better to use vsnprintf instead of vsprintf in this case
(perhaps the same about debugger related files: perhaps we also should use
vsnprintf where possible)

Also patch seems to be reversed (for emu386.cc only)

Andris



- Raw text -


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