FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [June 2011 Threads] MSP430X Printf Bug FixPosted by incoherent on June 8, 2011 There is a bug in printf-stdarg.c when compiling for the large data model.
Line 150:
register char *s = (char *)va_arg( args, int );
Should change to:
register char *s = (char *)va_arg( args, char * );
RE: MSP430X Printf Bug FixPosted by MEdwards on June 8, 2011 I think there are three supported compilers, which one needs the change?
RE: MSP430X Printf Bug FixPosted by incoherent on June 8, 2011 I've tested this on CCS4.2.3, however it is probably relevant to all three (if they support the large data model).
With the large data model, data pointers (e.g. char *) are 32 bits, whereas the same pointers are 16 bits in the small memory model. In both cases ints are 16 bits, so when the va_arg is incremented it ends up pointing at the high word of the char pointer, rather than pointing to the next argument.
This should fail on any platform in which pointers are not the same size as ints (assuming TI's va_arg implementation is correct).
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|