|
|
View previous topic :: View next topic |
Author |
Message |
temtronic
Joined: 01 Jul 2010 Posts: 9133 Location: Greensville,Ontario
|
|
Posted: Mon Feb 17, 2020 1:18 pm |
|
|
OK, I'm not a trained C programmer but the 1st program has 7 functions all called 'test'. When I started, variables could have a maximum of 2 characters as their name (A...ZZ ). Today you can have lots ! maybe 255 ? I don't know, never checked but many more than I care to type ! My point is you should not have similarly worded variables or names of functions. It can be confusing. Heck CCS uses the name 'char' to describe data from 00-255, same as an unsigned int8..so quick, will the compiler make them the same ,if the functions are named the same ? I don't know....
Then there's the 'it's CCS C NOT 'C' ' problem.... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19255
|
|
Posted: Mon Feb 17, 2020 1:41 pm |
|
|
Yes, there are occasions where 'similar' types like this will confuse
overloading. Not in this case (since char is a signed int8, on a PIC24),
but it certainly can happen.
Thinking about it (and when I have seen this), I think it only happens
when the 'types', are not actually types, but are #defines.
If you look in the processor include file, there is a block like:
#define BYTE unsigned int8
#define BOOLEAN int1
Only normally a couple (there is a larger similar list for when you are not
using the CCS compiler). The ones defined here will 'confuse' the
overloading.
So if you have two functions, one using BYTE, and one using unsigned int8
then both will be seen as referring to the same type. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|