Seeing this in the newest ChibiOS release:
../../modules/ChibiOS/os/rt/include/chschd.h: In function 'void ch_sch_prio_insert(ch_queue_t*, ch_queue_t*)':
../../modules/ChibiOS/os/rt/include/chschd.h:509:26: error: cast from 'ch_queue_t* {aka ch_queue*}' to 'thread_t* {aka ch_thread*}' increases required alignment of target type [-Werror=cast-align]
(((thread_t *)cp)->hdr.pqueue.prio >= ((thread_t *)tp)->hdr.pqueue.prio));
Build error using thread statistics Topic is solved
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Build error using thread statistics
I haven't looked into it yet. Try to put an intermediate cast to void* in there.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Build error using thread statistics
Hi,
I examined several occurrences of this error, there are several of those, but the code is safe as is.
-Werror=cast-align is not a default option, why are you using it? are you using some peculiar setup?
Note that none of the tested compilers complains about it: GCC, LLVM, Keil, IAR.
Giovanni
I examined several occurrences of this error, there are several of those, but the code is safe as is.
-Werror=cast-align is not a default option, why are you using it? are you using some peculiar setup?
Note that none of the tested compilers complains about it: GCC, LLVM, Keil, IAR.
Giovanni
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Build error using thread statistics
Hi,
Update, I modified things to be compatible with "-Wcast-align=strict". I think you are compiling the code using the C++ compiler (correct?), this is why you are seeing the warnings.
I fixed all casts to (thread_t *), post here if you find more instances of the problem. Cleaning things up is always a good thing.
Giovanni
Update, I modified things to be compatible with "-Wcast-align=strict". I think you are compiling the code using the C++ compiler (correct?), this is why you are seeing the warnings.
I fixed all casts to (thread_t *), post here if you find more instances of the problem. Cleaning things up is always a good thing.
Giovanni
Re: Build error using thread statistics
Giovanni wrote:Hi,
Update, I modified things to be compatible with "-Wcast-align=strict". I think you are compiling the code using the C++ compiler (correct?), this is why you are seeing the warnings.
I fixed all casts to (thread_t *), post here if you find more instances of the problem. Cleaning things up is always a good thing.
Giovanni
Yes, C++ compiler - great thanks!
Who is online
Users browsing this forum: No registered users and 8 guests