2014-03-27 12:50 AM
I ported a a firmware from IAR Embedded Workbench to Kiel version 4(stm32l100)
I get this warning after building the project in Kiel but not in IAR Warning: &sharp815-D: type qualifier on return type is meaningless.
extern const LonNvDescription* const LonGetNvTable(void);
extern const LonApiError LonPollNv(const unsigned index);
what is the correct way to define this type of function
#stm32l100 #kiel-version-42014-03-27 06:34 AM
It does seem a bit odd, is the value returned stored in ROM/FLASH? and unmodifiable for that reason? The Keil forum might be worth a try, I'm sure there are people there who'll argue the C specification, and ordering of const, static, etc with you. What does LINT or MISRA say?
2014-04-01 01:40 AM
Hello sanil.prem,
The type qualifier “ const � is ignored by the compiler since the return value cannot be const.
You shoud delete it.Best Regards,
NouhaI ported a a firmware from IAR Embedded Workbench to Kiel version 4(stm32l100)
I get this warning after building the project in Kiel but not in IAR Warning: #815-D: type qualifier on return type is meaningless.
extern const LonNvDescription* const LonGetNvTable(void);
extern const LonApiError LonPollNv(const unsigned index);
what is the correct way to define this type of function
2014-04-01 01:49 PM
''The Keil forum might be worth a try''
He has already posted exactly the same on the Keil forum - and, unsurprisingly, received much the same answer:http://www.keil.com/forum/56897/
@Sanil: There is no requirement on any compiler to produce any warnings at all - so it should come as no surprise that different compilers, from different vendors, choose to give give some different warnings.If you want a whole different set of warnings, just try putting this code through GCC...''what is the correct way to define this type of function''
Again: what, exactly, do you think ''this type'' of function is? Why do you think the 'const' qualifier is necessary or appropriate? What are you trying to achieve by it?2014-04-01 08:47 PM
2014-04-01 08:57 PM