[comp.unix.aix] Programming Standards

chris@ankh.ftl.fl.us (Chris Bare) (05/11/91)

I am developing code on AIX 3.1 and I would like to make sure that it
complies with as many standards as possible. Presently I am including
the following in my CFLAGS:

-qlanglvl=ansi -D_POSIX_SOURCE

and the following headers in all my .c files:

#include <stdio.h>
#include <stdlib.h>                             /* ANSI */
#include <unistd.h>                             /* POSIX */

I believe that these should make my code ANSI and POSIX compatible.
I have several questions about this however:

1. Does true ANSI C allow the K&R style function definitions?

2. Is there a way (in AIX 3.1) to give warnings or errors on K&R style
   function definitions?

3. Is there a way to require function prototypes? (again warnings or errors)

4. Are there any other flags, includes, etc. that I should use to make my
   code more standards-compliant and more portable?

Thanks in advance for all info.

Chris Bare
chris@ankh.ftl.fl.us
CASI-RUSCO