Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Some features lose the static keyword on functions

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
mvolkar Posted - Jun 18 2018 : 1:46:14 PM
I don't know if this is by design or not, but I have noticed it for a while and finally decided to report the behavior. Basically, some features of Visual Assist (at least Change Signature and Create Implementation) seem to lose the static keyword from my function prototype. For example, given the following prototype:


static int TestFunction(int arg1, float arg7, double arg3);


If I use the Create Implementation feature, I get the following (notice no static keyword):

int TestFunction(int arg1, float arg2, double arg3)
{

}


Similarly, if I manually add the static keyword to the function definition and then invoke the Change Signature feature, it will remove the static keyword from the definition (but not the prototype).

I have encountered this behavior in multiple versions of Visual Assist, but have recently reproduced it with build 2270. It seems to me that this is a bug, but perhaps it is by design?
3   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jun 20 2018 : 11:54:32 PM
Your reasoning makes sense. I've put in a bug report for you:

case=117210
mvolkar Posted - Jun 18 2018 : 4:31:30 PM
I understand that this is legal C syntax. However, MISRA C:2012 Rule 8.8 states: "The static storage class specifier shall be used in all declarations of objects and functions that have internal linkage." It provides further amplification by saying: "Since definitions are also declarations, this rule applies equally to definitions." So, in our code, which is attempting to be more or less MISRA compliant, leaving the static keyword off of the definition is not an option.

I can understand the behavior of the Create Implementation feature, but I find the behavior of Change Signature to be irritating at best, since it removes something that I had there.
Zeblote Posted - Jun 18 2018 : 2:18:32 PM
That's correct though. You put the static keyword in the declaraction only.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000