Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Receiving BAD INTERFACE from Insure++

LegacyForum
LegacyForum Posts: 1,664 ✭✭
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: [email protected]

another one:
Declaration conflicts with interface: atoi
>> int atoi (char *str);
Please contact Parasoft support: [email protected]

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

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    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);
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭

    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.

Tagged