Receiving BAD INTERFACE from Insure++

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in Insure++
During Compilation, BAD INTERFACE pops up..
It appears that BAD INTERFACE error occurs when I have a extern to a function:

I have the following:

Declaration conflicts with interface: syslog
>> extern int syslog (int priority, char *fmt, ...);
Please contact Parasoft support: support@parasoft.com

another one:
Declaration conflicts with interface: atoi
>> int atoi (char *str);
Please contact Parasoft support: support@parasoft.co

I have had my own syslog for 22 years and so I wish to either figure out how to fix this issue, or turn off the BAD INTERFACE for the specific lines. Since we are cross platform over several different *NIX platforms, we have developed several common functions that may not exist on one platform or another (ie: nanosleep, atoi, etc). Thus, this happens to more than just above examples.

Any ideas?
Chris Litchfield
Tagged:

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    BAD_INTERFACES are generally not harmful. You can make them disappear using the psrc option 'suppress BAD_INTERFACE'.

    In this case, you are probably getting the message because the standard signature for syslog is

    CODE
    void syslog(int priority, const char *message, ... /* argument */);

    and that is probably the version Insure++ expects for the compiler/platform you are on.

    http://www.opengroup.org/onlinepubs/799098...xsh/syslog.html

    You could also change your local definition to match the standard, and the error message should go away.

    Likewise for atoi, whose signature is:

    CODEint atoi(const char *str);
  • LegacyForumLegacyForum Posts: 1,669 ✭✭

    BAD_INTERFACES are generally not harmful. You can make them disappear using the psrc option 'suppress BAD_INTERFACE'.

    In this case, you are probably getting the message because the standard signature for syslog is

    CODE
    void syslog(int priority, const char *message, ... /* argument */);


    and that is probably the version Insure++ expects for the compiler/platform you are on.

    http://www.opengroup.org/onlinepubs/799098...xsh/syslog.html

    You could also change your local definition to match the standard, and the error message should go away.

    Likewise for atoi, whose signature is:

    CODE
    int atoi(const char *str);

    Excellent. This is what I was needing. When I switched my prototypes to match the standard. When I did I found a ton more issues.
Sign In or Register to comment.