This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Internal compiler error


#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;
}



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