This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
casting problem in c
- To: gcc-bugs at gcc dot gnu dot org
- Subject: casting problem in c
- From: Rajesh Cheethirala <rajeshc at empowertel dot com>
- Date: Mon, 31 Jul 2000 12:25:11 -0700
- Organization: empowerTel Networks
If I have code that looks like this:
/* put component tag */
*pdup.uc++ = TC_ERROR;
/* leave the length indicator blank */
pdup.us++;
I get a core dump after I build and execute at the last line.
The union looks like this
typedef union
{
pduhdr_t *hdr;
unsigned char *ptag;
void *vp; /* internal use only */
char *c;
unsigned char *uc;
short *s;
unsigned short *us;
int *i;
unsigned int *ui;
long *l;
unsigned long *ul;
} pduptr_t;
My system configuration is as follows:
System Configuration: Sun Microsystems sun4u
Memory size: 2432 Megabytes
System Peripherals (Software Nodes):
SUNW,Ultra-4
SunOS helia 5.6 Generic_105181-17 sun4u sparc
Thanks
Rajesh