| [Freeciv-Dev] Re: (PR#8547) GCC poisoning v2[Top] [All Lists][Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
 
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8547 >
On Mon, Apr 19, 2004 at 02:46:46PM -0700, Per I. Mathisen wrote:
An alternative approach. The attached script produces the following
output:
./amiga/amigaclient.c: usleep() function. (because select() is too slow and not 
needed to be
./amiga/amigaclient.c:void usleep(unsigned long usec)
./amiga/amigaclient.c:/* remove usage of strerror prototype */
./amiga/amigaclient.c:#define strerror strerror_unuse
./amiga/amigaclient.c: strerror() which also understand the non ANSI C errors. 
Complete.
./amiga/amigaclient.c:#undef strerror /* remove usage of strerror prototype */
./amiga/amigaclient.c:const char *strerror(unsigned int error)
./amiga/amigaserver.c: usleep() function. (because select() is too slow). 
Complete.
./amiga/amigaserver.c:void usleep(unsigned long usec)
./amiga/amigaserver.c: strerror() which also understand the non ANSI C errors. 
Complete.
./amiga/amigaserver.c:/* const char *strerror(unsigned int error) */
./amiga/amigaserver.c:char *strerror(int error)
./amiga/vsnprintf.c:int vsnprintf(char *buffer, int buffersize, const char 
*fmt0, va_list ap)
./amiga/vsnprintf.c:int snprintf(char *buf, int n, const char *fmt, ...)
./amiga/vsnprintf.c:  r = vsnprintf(buf, n, fmt, ap);
./client/gui-mui/gui_main.c:      printf("%s\n", strerror(errno));
./common/ioz.c:  snprintf.
./common/shared.c: it does snprintf to the end of an existing string.
./common/support.c: vsnprintf() replacement using a big malloc()ed internal 
buffer,
./common/support.c: whether all native vsnprintf() functions null-terminate on
./common/support.c: do as above nevertheless; check_native_vsnprintf() above 
tests this.)
./common/support.c: safe.  But somewhat safe, and at least safer than using raw 
snprintf!
./common/support.c:  r = vsnprintf(str, n, format, ap);
./common/support.c:     fprintf(stderr, "Could not allocate %i bytes for 
vsnprintf() "
./common/support.c:    r = vsnprintf(buf, n, format, ap);
./common/support.c:      fprintf(stderr, "Overflow in vsnprintf replacement!"
./common/support.c:  return strcasecmp (str0, str1);
./common/support.c:  return strncasecmp (str0, str1, n);
./common/support.c:#include <unistd.h>          /* usleep, fcntl, gethostname */
./common/support.c:  usleep(usec);
./common/support.c:  return strerror(errnum);
./common/support.c:           _("error %d (compiled without strerror)"), 
errnum);
./common/support.c:#include <unistd.h>          /* usleep, fcntl, gethostname */
./common/support.c:  Call gethostname() if supported, else just returns -1.
./common/support.c:  return gethostname(buf, len);
As you can see there is only one (client/gui-mui/gui_main.c)
occurrence of a bad use.
        Raimar
-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "With a PC, I always felt limited by the software available.
   On Unix, I am limited by my knowledge."
    -- Peter J. Schoenster <pschon@xxxxxxxxxxxxxxxxx>
 a.tar.gz Description: application/tar-gz
 
 
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Raimar Falke, 2004/04/20
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Per I. Mathisen, 2004/04/20
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Raimar Falke, 2004/04/20
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Jason Short, 2004/04/20
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Per I. Mathisen, 2004/04/20
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Raimar Falke, 2004/04/20
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Jason Short, 2004/04/20
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2,
Raimar Falke <=
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Raimar Falke, 2004/04/21
[Freeciv-Dev] Re: (PR#8547) GCC poisoning v2, Raimar Falke, 2004/04/21
 
 |  |