MISRA Discussion Forums
What is the method of defining the Function Prototype - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: General Questions (https://forum.misra.org.uk/forumdisplay.php?fid=27)
+--- Thread: What is the method of defining the Function Prototype (/showthread.php?tid=1450)



What is the method of defining the Function Prototype - prem_annam - 23-08-2018

Hi,

I am facing the MISRA.VAR.HIDDEN error.

When i defined the function prototype with parameters and using the same parameters name while calling the function.

Can any one give me suggestion how can it will be modified to avoid the error.

Thanks in advance.


Re: What is the method of defining the Function Prototype - dg1980 - 23-08-2018

Can you provide a code snippet demonstrating the problem?
Also, which rule is reported as being violated (i assume MISRA.VAR.HIDDEN is some kind of incomplete static analyis tool output)?


Re: What is the method of defining the Function Prototype - phaedsys - 23-08-2018

Hi

This looks to be a tool specific question. They support team for the tool should be abler to help. They can tell you what the actual violation the tool is picking up. Then you can fix that. If you still have a question on MISRA implementation then ask again.


Re: What is the method of defining the Function Prototype - phaedsys - 23-08-2018

delete miss post


Re: What is the method of defining the Function Prototype - prem_annam - 23-08-2018

dg1980 Wrote:Can you provide a code snippet demonstrating the problem?
Also, which rule is reported as being violated (i assume MISRA.VAR.HIDDEN is some kind of incomplete static analyis tool output)?


Hi,
This is thefunction prototype : int wc_ed25519_init(ed25519_key* key);
and the function call is ret = wc_ed25519_init(keyPair);

ERROR:Identifier 'key' hides identifier in an outer scope which is reported from KlocWork tool analysis.


Re: What is the method of defining the Function Prototype - dg1980 - 23-08-2018

Looks like there might be a global variable named key somewhere.
The message should disappear if you rename either of them.


Re: What is the method of defining the Function Prototype - misra-c - 04-10-2018

The MISRA C working group can not make comments about particular tools, but the post by dg1980 would appear relevent.