You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@bellsouth.net> on 2000/04/26 02:55:17 UTC

auto configuration and full function prototypes

Can we assume that proper function prototypes (i.e., with argument
declarations) are available (and used) in system header files?  

In some cases (e.g., sigwait()), there are a couple of flavors which
can be readily identified from the number of arguments.

It is pretty simple to try to compile something like this

  #include <signal.h>

  void main(void)
  {
    sigset_t set;
    sigwait(&set);
  }

and set SIGWAIT_HAS_ONE_ARG (or some such) if it successfully
compiles, but if the declaration used from signal.h is "int sigwait()"
then configuration is broken on that platform.

Any better ideas?

Thanks...
-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: auto configuration and full function prototypes

Posted by Jeff Trawick <tr...@bellsouth.net>.
Greg Ames had the idea that I could first do a test to see if
prototypes are broken, and if prototypes are broken then don't do any
tests which depend on good prototypes.

test for broken prototypes (and/or some compiler setting that allows
the compile to succeed when an incorrect argument list is provided):

  #include <string.h>

  void main(void)
  {
    char buf[1];

    strcpy(buf,buf,buf,buf,buf,buf);
  }

If it compiles, set ARG_CHECKING_IS_BROKEN.

In subsequent tests that don't work properly with broken system
prototypes, make sure the compile will work when
ARG_CHECKING_IS_BROKEN is defined.

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...