whitcomb@EROS.BERKELEY.EDU (Gregg Whitcomb) (05/19/89)
version: g++ 1.35.0
config: vax (ultrix 3.0)
problem: warning message "empty declaration" for structures
declared after a typedef. Works okay if the typedef is moved after
the struct declaration. Both test.cc and test.c run correctly regardless
of the error.
---------------------------------------
/* test.h */
typedef struct a A;
struct a
{
int x;
int y;
int z;
};
/* test.cc (warning message when compiled) */
#include <stream.h>
extern "C"
{
#include "test.h"
}
main()
{
struct a s;
s.x = 1;
cout << s.x << "\n";
}
/* test.c (works fine) */
#include <stdio.h>
#include "test.h"
main()
{
struct a s;
s.x = 1;
printf("%d\n",s.x);
}
---------------------------------------
-Gregg Whitcomb whitcomb@ic.berkeley.edu