cancel
Showing results for 
Search instead for 
Did you mean: 

I ported a a firmware from IAR Embedded Workbench to Kiel version 4(stm32l100)

sundar
Associate II
Posted on March 27, 2014 at 08:50

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-4
This discussion is locked. Please start a new topic to ask your question.
5 REPLIES 5
Posted on March 27, 2014 at 14:34

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?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Nickname306_O
Senior
Posted on April 01, 2014 at 10:40

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,

Nouha

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: #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

Posted on April 01, 2014 at 22:49

''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?
A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
sundar
Associate II
Posted on April 02, 2014 at 05:47

Hello Nouha ,

Thanks for the info ,.it works fine now ,!(No warnings )

Rergards

Sanil

sundar
Associate II
Posted on April 02, 2014 at 05:57

Hello

0690X0000060ModQAE.gif,

Initially I was in dilemma , was relatively new to IAR when compared to Kiel ,

about that function , my understanding now is 'the function call cannot change the return type ..!)

Regards

Sanil