Lyle Taylor wrote:
> Why is it that the preprocessor and compiler can't just be smart
> enough to handle it?
I think they do, they just warn anyway.
My quick test attached; looks fine on 2.95-3.4.
Rup.
#include <stdio.h>
int main(void)
{
printf("I'm a little teapot\n");
#include "teapot.h"
printf("short and stout\n");
printf("here's my handle\n");
#include "teapot2.h"
printf("here's my spout\n");
return 0;
}
//empty header, no newline at end of file
//
#ifndef _H_TEAPOT2
#define _H_TEAPOT2
// no newline at end of file
#endif