C and C++


LANG.ID.NU.LIBFN : Library Function Override

Summary

A procedure defined in user code has a name that matches a function declared in a system include header in the project. The procedure and header do not need to be in the same compilation unit.

System header status is determined by the setting of configuration parameter SYSTEM_INCLUDE_PATHS.

Properties

Class Name Library Function Override
Significance security
Mnemonic LANG.ID.NU.LIBFN
Categories
MisraC2023 MisraC2023:5.8 Identifiers that define objects or functions with external linkage shall be unique
  MisraC2023:5.9 Identifiers that define objects or functions with internal linkage should be unique
Misra2012 Misra2012:5.8 Identifiers that define objects or functions with external linkage shall be unique
  Misra2012:5.9 Identifiers that define objects or functions with internal linkage should be unique
Misra2004 Misra2004:5.7 No identifier name should be reused
AUTOSARC++14 AUTOSARC++14:A2-10-5 An identifier name of a function with static storage duration or a non-member object with external or internal linkage should not be reused.
  AUTOSARC++14:A17-0-1 Reserved identifiers, macros and functions in the C++ standard library shall not be defined, redefined or undefined.
MisraC++2008 MisraC++2008:2-10-5 The identifier name of a non-member object or function with static storage duration should not be reused.
  MisraC++2008:17-0-1 Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined.
CWE CWE:657 Violation of Secure Design Principles
  CWE:710 Improper Adherence to Coding Standards
  CWE:1076 Insufficient Adherence to Expected Conventions
CERT-C CERT-C:DCL23-C Guarantee that mutually visible identifiers are unique
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default. To enable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="Library Function Override"

Example

#include <math.h>

double fabs (double x){ /* 'Library Function Override' warning issued here */
  return x + 1;
}

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.