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] [March 2015 Threads]
Just got around to upgrading to V8.2.0 Using Atmel Studio 6.2.1563 which uses ARM GCCNative4.8.1443
I get the following warning when compiling:
Warning 1 cast increases required alignment of target type [-Wcast-align] ...srcASFthirdpartyfreertosfreertos-8.2.0sourcequeue.c 343 16
Can't figure it out. Any ideas?
Thanks in advance,
Bill
Interestingly I've never seen that warning. Projects created in Atmel Studio do, by default, have a very 'elaborate' set of warnings turned on individually. I normally just -Wall -Wextra.
It is a genuine warning non-the-less:
pxNewQueue = ( Queue_t * ) pcAllocatedBuffer;
pcAllocatedBuffer is a char*, with no alignment requirement. pxNewQueue is a Queue_t * with a 4 byte alignment requirement. Hence it is warning you that the alignment might not be correct after the assignment.
However, what the compiler does not know is that pcAllocatedBuffer is guaranteed to have 8-bit alignment as it was dynamically allocated. Therefore, it is a valid warning, but it is warning you about something that cannot possibly happen.
Regards.
"However, what the compiler does not know is that pcAllocatedBuffer is guaranteed to have 8-bit alignment as it was dynamically allocated. Therefore, it is a valid warning, but it is warning you about something that cannot possibly happen"
I'm assuming you meant 8 byte alignment.
I'm assuming you meant 8 byte alignment.
yes :o)
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.