httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@engelschall.com (Ralf S. Engelschall)
Subject Re: PLEASE try compiling snprintf.c (was: Re: snprintf.c uploaded)
Date Sun, 12 Jan 1997 11:05:50 GMT

In article <Pine.BSF.3.95.970112012155.17488t-100000@alive.ampr.ab.ca> you wrote:

> Ok, everyone please grab a copy, rename snprintf and vsnprintf in the file
> to something else, then try compiling (with -Wall and -ansi if your
> compiler supports them) on all platforms you can.  eg. 
>   gcc -ansi -Wall -c snprintf.c

> ...and report any errors or warnings.  Please also send a list of
> platforms it compiled on without problems.

Hmmmm... under my FreeBSD box I got:

rse@en1:/u/rse
:> uname -a
FreeBSD en1 2.1.5-RELEASE FreeBSD 2.1.5-RELEASE #0: Sat Nov 23 10:19:51 MET
1996     rse@en1:/usr/src/sys/compile/EN1  i386
rse@en1:/u/rse
:> gcc -ansi -Wall -c snprintf.c
snprintf.c: In function `snprintf':
snprintf.c:739: argument `format' doesn't match prototype
/usr/include/stdio.h:295: prototype declaration
snprintf.c:739: number of arguments doesn't match prototype
/usr/include/stdio.h:295: prototype declaration
snprintf.c: In function `vsnprintf':
snprintf.c:756: argument `format' doesn't match prototype
/usr/include/stdio.h:296: prototype declaration
snprintf.c:756: argument `ap' doesn't match prototype
/usr/include/stdio.h:296: prototype declaration
rse@en1:/u/rse
:>

When I replace the #include <stdio.h> (which has the FreeBSD prototype) then
it compiles without problems. Here is the diff:

*** snprintf.c  Sat Jan 11 16:19:01 1997
--- snprintf.c.n    Sun Jan 12 12:03:17 1997
***************
*** 1,4 ****
! #include <stdio.h>
  #include <ctype.h>
  #include <sys/types.h>
  #include <varargs.h>
--- 1,8 ----
! 
! #ifndef NULL
! #define NULL (void *)0
! #endif
! 
  #include <ctype.h>
  #include <sys/types.h>
  #include <varargs.h>
***************
*** 730,736 ****
      if ( ccp )
    *ccp = cc ;
  }
- 
  
  int snprintf( buf, len, format, va_alist )
      char *buf ;
--- 734,739 ----

                                        Ralf S. Engelschall
                                        rse@engelschall.com
                                        http://www.engelschall.com/

Mime
View raw message