This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

mini program does not compile



The tiny program (under Windows 95) below gives me:

(C:\GNUWIN32\B18\H-I368 .... CC1PLUS.EXE 1136) In cygwin_exept_handler


#include <stdlib.h>
#include <stdio.h>


#define alignof(TYPE) (sizeof(struct{char c; TYPE x;}) - sizeof(TYPE))

template <class T>
struct test {
  int x;
  inline void fudge() {
    int h = alignof(T);
    printf("x %d\n",h);
  }
};


int main (int argc, char** argv) {

  return 0;

}


Compilation without problems under Linux.

What is the problem? What can I do?


PS:
If I change the program as follows, the problem goes away

struct foo {
  int i;
};

struct test {
  int x;
  inline void fudge() {
    int h = alignof(foo);
    printf("x %d\n",h);
  }
};


-- 
	-lauther

----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens ZT AN 1         Internet: Ulrich.Lauther@mchp.siemens.de
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]