Regarding compiler option "-mstrict" for SPARC Processor
parthasarathy
partha_22@yahoo.com
Wed Sep 15 12:02:00 GMT 2004
Hi !!
Iam facing a problem
struct name
{
int a[5];
};
struct mrreqchgresr_s
{
SIGSELECT signo; /* Signal number
*/
W16 cell; /* Cell individual
*/
W8 chgType; /* Change type
*/
/* 0 = "Upgrade abis
path" */
/* 1 = "Downgrade abis
path" */
W16 lpset; /* LPSET individual
*/
W8 noOfLpdchs; /* Number of LPDCHs
*/
W16 lpdchInd[8]; /* List of LPDCH
individuals */
W8 result; /* Request result
*/
/* 0 = Successful, change
possible */
/* 1 = Unsuccessful, no
change possible */
};
Two structs are defined and then there was a faulty
definition of the "signal" using the the
wrong struct and then trying to send the signal gave
the fault, like:
#define MRREQCHGRESR_S sizeof(struct mrreqchgres_s)
Later on when sending the signal like following it
gave the error because the memory allocated
is not enough:
sig_p = OS_alloc(MRREQCHGRESR_S, MRREQCHGRESR);
sig_p -> mrreqchgresr.result = FALSE;
OS_send(&sig_p, cceProcessId);
The correct way of coding this should be :
#define MRREQCHGRESR_S sizeof(struct mrreqchgresr_s)
and then sending of signal:
sig_p = OS_alloc(MRREQCHGRESR_S, MRREQCHGRESR);
sig_p -> mrreqchgresr.result = FALSE;
OS_send(&sig_p, cceProcessId);
This works and doesn't generate any fault in RPP nor
Razorsim.
The problem is that there should have been a restart
of the Razorsim when executing the
"faulty" code.
regards
/clas
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
More information about the Gcc-help
mailing list