CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Mon Feb 17, 2020 9:03 pm

All times are UTC+01:00

Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Mar 28, 2016 1:36 pm 

Joined: Fri Nov 23, 2012 11:42 am
Posts: 54
I am in the process of cleaning up an IO driver to make it available in the codesys store. As part of this process all libraries are supposed to comply with a pre-defined set of static analysis rules including naming conventions.
There are standard interfaces that do not comply with the naming conventions and so give static analysis failures. e.g. from IoDrvUpdateConfiguration I get:
NC0015: Invalid variable name 'nCount'. Expected prefix 'di'

Looking at the documentation for static analysis I find that I can suppress this warning using
{attribute 'naming' := 'omit'}

This does suppress the warning, however I now get a compiler warning
C0351: The attribute naming is unknown and will be ignored by the compiler.

I have tried disabling the compiler warning using
{warning disable C0351}

however this has no effect.
Please advise how I can write code that fulfils this standard interface, satisfies your standard static analysis rules, and does not throw compiler warnings?
To be honest I would prefer it if static analysis didn't complain at all about function blocks implementing an interface. It is a waste of time going and adding suppressions in the implementing function block. Raising the static analysis warning where the interface is defined makes sense, but not where it is implemented. Perhaps a JIRA entry could be raised to make this improvement. This may seem a trivial request, static analysis can be a great tool to improve readability and quality, but not if it wastes time on code that the developer cannot fix.

PostPosted: Tue Apr 26, 2016 6:22 pm 
Frequent User
Frequent User
User avatar

Joined: Tue Jun 06, 2006 9:03 am
Posts: 413
Hi David,

I had a similar problem.
The attribute "naming" should be recognized, but isn't. This is a bug in 3.5 SP8 and hasn't been fixed yet.

The jira issue is CDS-47159.

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00

Who is online

Users browsing this forum: No registered users and 2 guests

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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited