< Hi, I am working on solaris 2.6 (sparc) and i m having a lot of
< bus error ..core dumped. I checked my code and one common thing that i
< was that most of the errors ocurr at a point where the pointers are
< casted. When i use dbx to debug the application i m able to access the
< and i can see the contents of that memory but without de* the
< application gives bus error...core dumped. I tried to get help from a
< manuals but i couldn't find anything interesting. can anybody please
Time to re-read a C manual, ah?
Pointer type-casting is dangereous and may cause alignment problems
resulting in SIGBUS.
char buf = "disaster";
int *p = (int *)&buf;
cout << *p << endl; // coredumps on Sun, but necessarily on
// other architectures, like MIPS or Intel