View previous topic :: View next topic |
Author |
Message |
EdWaugh
Joined: 07 Dec 2004 Posts: 127 Location: Southampton, UK
|
make8 Compiler Error in v4.124 |
Posted: Sun Aug 14, 2011 5:21 am |
|
|
Hi All,
I seem to be having another problem with a new CCS release. v4.124 throws an 'Invalid parameters to built in function' error on some code which v4.121 found acceptable. I have reported the bug to CCS and got the usual slightly rude and uninterested response but hopefully they will get around to fixing it. I should point out that they did fix the bug I reported a while ago and was discussed here:
http://www.ccsinfo.com/forum/viewtopic.php?t=44391&highlight=
I have written some test code which generates the error:
errortest_main.c
Code: |
#include <18f87J11.h>
#pragma device adc=10 HIGH_INTS=TRUE *=16
#include "typedefs.h"
#include "errortest_main.h"
void main(void)
{
uint16_t test_array[2];
test_array[0] = 0x1234;
test_array[1] = 0x5678;
test_function(test_array);
}
uint8_t test_function(uint16_t *ui16_array)
{
uint8_t test_byte = make8(ui16_array[0], 1);
return test_byte;
} |
errortest_main.h
Code: |
#ifndef __ERRORTEST_MAIN_H
#define __ERRORTEST_MAIN_H
void main(void);
uint8_t test_function(uint16_t *ui16_array);
#endif // __ERRORTEST_MAIN_H
|
Let me know if you have similar problems or can see an error in what I have written, I'll update when/if there is a fix.
Cheers
Ed |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sun Aug 14, 2011 7:42 am |
|
|
Seems like understanding types is luck of the draw for CCS C. You have to be aware of unexpected changes with new versions. Making the code more explicite often helps, also in this case.
Code: | test_byte = make8((uint16_t)(ui16_array[0]), 1); |
|
|
|
EdWaugh
Joined: 07 Dec 2004 Posts: 127 Location: Southampton, UK
|
CCS are issuing a fix |
Posted: Fri Aug 19, 2011 5:17 am |
|
|
Hi FvM,
Thanks for your reply, I had not tried explicitly typing the variable, I do feel like that shouldn't be necessary in this case tho.
I got a response from CCS and they sent me a dll that fixes the error, this will be included in the next release.
Cheers
Ed |
|
|
|