no way at all ot predict data placements (unless align specified, then you
have to watch array's bias)
you may avoid this problem using 'char' assigments:
TxFrame1[offset++] = 0x01;
TxFrame1[offset] = 0x00;
instead of:
*(int *)&TxFrame1[offset] = 0x0001;
~d
On Tuesday 05 August 2003 19:02, Akshay wrote:
> Thanks Dmitry,
>
> Is there a way to fix this problem?
>
> Akshay
>
> --__--__--
>
> Message: 6
> From: Dmitry <[email protected]>
> Organization: EIS
> To: [email protected]
> Subject: Re: [Mspgcc-users] linker error
> Date: Mon, 4 Aug 2003 23:40:41 +0400
> Reply-To: [email protected]
>
> This thing is covered in docs (tips & tricks):
> when performing type conversion, you must be sure, that=20
> biased char variable is located at even address.
>
> So, if &TxFrame1[offset] is odd located, you have a problem.
>
> When you comment line 'offset++', you set =20
> &TxFrame1[offset]
> even-located and everything is ok.
>
> ~d
>
> Message: 5
> Date: 4 Aug 2003 19:13:37 -0000
> From: "Akshay" <[email protected]>
> To: [email protected]
> Subject: [Mspgcc-users] linker error
> Reply-To: [email protected]
>
> Hello All,
>
> I'm getting a linker error when I try to copy strings.
>
> Following is the code snippet:
>
> ===================================================
> {
> int offset=DNS_NAME_OFS;
>
> TxFrame1[offset] = 0x03;
> offset++;
>
> strcpy(&TxFrame1[offset], "www");
> offset += strlen("www");
>
> TxFrame1[offset] = 0x03;
> offset++;
>
> strcpy(&TxFrame1[offset], "msn");
> offset += strlen("msn");
>
> TxFrame1[offset] = 0x03;
> offset++;
>
> strcpy(&TxFrame1[offset], "com");
> offset += strlen("com");
>
> // TxFrame1[offset] = 0x00; >> Error occurs when I
> uncomment
> // offset++; >> these lines
>
> *(unsigned int *)&TxFrame1[offset] = 0x0001;
> offset += 2;
>
> *(unsigned int *)&TxFrame1[offset] = 0x0001;
>
> }
> ===================================================
>
> Here's the error:
>
> ===================================================
> msp430-gcc.exe cs8900.c tcpip.c main.c -mmcu=msp430x149 -o
> ourserver.exe -g -lc -lgcc
> msp430-gcc.exe cs8900.c tcpip.c main.c -mmcu=msp430x149 -g -O -o
> ourserver.elf
> /cygdrive/c/DOCUME~1/ASAXEN~1.CS-/LOCALS~1/Temp/ccyj0kYi.o(.text+0x188c):
> In function `PrepareUDP_DATA_FRAME':
> /cygdrive/c/Documents and
> Settings/asaxena.CS-UML/iCricket/NW_Stack/tcpip.c:1034: internal
> error: unsupported relocation error
> /cygdrive/c/DOCUME~1/ASAXEN~1.CS-/LOCALS~1/Temp/ccyj0kYi.o(.text+0x1890):/c
>ygdrive/c/Documents and
> Settings/asaxena.CS-UML/iCricket/NW_Stack/tcpip.c:1037:
> internal error: unsupported relocation error
> msp430-gcc.exe cs8900.c tcpip.c main.c -mmcu=msp430x149 -S
> msp430-objcopy.exe -O ihex ourserver.exe ourserver.d43
> msp430-objcopy.exe -O srec ourserver.exe ourserver.s19
> ===================================================
>
>
> Akshay
> [email protected]
> [email protected]
>
> ___________________________________________________
> Download the hottest & happening ringtones here!
> OR SMS: Top tone to 7333
> Click here now:
> http://sms.rediff.com/cgi-bin/ringtone/ringhome.pl
>
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
--
/*****************************************************************
("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ
`6_ 6 ) `-. ( ).`-.__.`) State Polytechnical Univ.
(_Y_.)' ._ ) `._ `. ``-..-' Radio-Physics Departament
_..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia
(il),-'' (li),' ((!.-' +7 (812) 5403923, 5585314
*****************************************************************/