delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/07/21/03:37:36

From: bill AT taniwha DOT org
Sender: bill AT delorie DOT com
Message-ID: <3795795E.B1B90655@taniwha.org>
Date: Wed, 21 Jul 1999 19:40:14 +1200
X-Mailer: Mozilla 4.6 [en] (X11; U; Linux 2.2.10 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: No more warnings...
References: <m116ZpN-000KuPC AT sloep101 DOT cs DOT vu DOT nl>
Reply-To: djgpp-workers AT delorie DOT com

Michel de Ruiter wrote:
> diff -ur ../djgpp/src/debug/common/dbgcom.c ./src/debug/common/dbgcom.c
> --- ../djgpp/src/debug/common/dbgcom.c  Mon Jun 28 10:01:40 1999
> +++ ./src/debug/common/dbgcom.c Sat Jul 17 07:06:00 1999
> @@ -21,8 +21,7 @@
>  #include <sys/fsext.h>
>  #include <io.h>
> 
> -extern char __libdbg_ident_string[];
> -static char *id = __libdbg_ident_string;
> +asm(".long ___libdbg_ident_string");

This may be better (maybe not, dunno) as

static __attribute__((unused)) char *id = __libdbg_ident_string;

Depends on preferences I guess.

> diff -ur ../djgpp/src/debug/fsdb/fullscr.c ./src/debug/fsdb/fullscr.c
> --- ../djgpp/src/debug/fsdb/fullscr.c   Mon Jun 28 10:01:44 1999
> +++ ./src/debug/fsdb/fullscr.c  Sat Jul 17 07:08:50 1999
> @@ -1615,7 +1615,7 @@
>             if (abs (exp) < 1000)
>               {
>                 d = *((long double*)(npx.reg + i));
> -               sprintf(dstr,"%+.19Lg", (double) d);
> +               sprintf(dstr,"%+.19Lg", d);

Looks ok to me.

> diff -ur ../djgpp/src/stub/stubify.c ./src/stub/stubify.c
> --- ../djgpp/src/stub/stubify.c Mon Jun 28 10:06:18 1999
> +++ ./src/stub/stubify.c        Sat Jul 17 07:12:22 1999
> @@ -68,13 +68,15 @@
>      ofext = ofilename + strlen(ofilename);
>    strcpy(ofext, ".exe");
>    if (access(ofilename, 0) == 0)
> +  {
> +    used_temp = 1;
>      for (ofile=0; ofile<999; ofile++)
>      {
> -      used_temp = 1;
>        sprintf(ofext, ".%03d", ofile);
>        if (access(ofilename, 0))
>         break;
>      }
> +  }

Though gcc *should* be able to pick the original up itself, this looks
good.

>    else
>      used_temp = 0;
> 
> diff -ur ../djgpp/zoneinfo/src/private.h ./zoneinfo/src/private.h
> --- ../djgpp/zoneinfo/src/private.h     Mon Jun 28 10:08:24 1999
> +++ ./zoneinfo/src/private.h    Sat Jul 17 07:23:16 1999
> @@ -186,7 +186,7 @@
>  void * irealloc P((void * pointer, int size));
>  void   icfree P((char * pointer));
>  void   ifree P((char * pointer));
> -char * scheck P((const char *string, const char *format));
> +const char *   scheck P((const char *string, const char *format));
> 
>  /*
>  ** Declarations for functions which shut up GCC $(GCC_DEBUG_FLAGS).
> diff -ur ../djgpp/zoneinfo/src/scheck.c ./zoneinfo/src/scheck.c
> --- ../djgpp/zoneinfo/src/scheck.c      Mon Jun 28 10:08:24 1999
> +++ ./zoneinfo/src/scheck.c     Sat Jul 17 07:22:52 1999
> @@ -8,7 +8,7 @@
> 
>  #include "private.h"
> 
> -char *
> +const char *
>  scheck(string, format)
>  const char * const     string;
>  const char * const     format;
> @@ -17,9 +17,9 @@
>         register const char *   fp;
>         register char *         tp;
>         register int            c;
> -       register char *         result;
> +       register const char *   result;
>         char                    dummy;
> -       static char             nada;
> +       static const char       nada;
> 
>         result = &nada;
>         if (string == NULL || format == NULL)
> @@ -53,7 +53,7 @@
>         *tp++ = 'c';
>         *tp = '\0';
>         if (sscanf(string, fbuf, &dummy) != 1)
> -               result = (char *) format;
> +               result = format;
>         ifree(fbuf);
>         return result;
>  }

seems sensible.

My 2 cents: other than the style quibble, everything looks ok to me.

Bill
-- 
Leave others their otherness.

- Raw text -


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