Internal compiler error

Alexander Usachev usachev@mx.ihep.su
Fri Apr 16 09:36:00 GMT 1999


#include <iostream.h>

struct User {
    char * name;
    char * id;
    int    dept;
  };

int cmp1(const void * p, const void * q) {
  return strcmp(static_cast<const User*>(p)->name, static_cast<const
User*>(q)->name);
}


main() {

  User heads[] = {
    "F.",    "d",     1,
    "E.",    "r",     2,
    "D.",    "t",     3,
    "C.",    "s",     4,
    "B.",    "n",     5,
    "A.",    "b",     6};

  // Error ?
  cout << cmp1(static_cast<const void *>(heads[0]), static_cast<const void
*>(heads[1]))
 << endl;
}



More information about the Gcc-bugs mailing list