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]

casting problem in c


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



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