JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++


LANG.STRUCT.DECL.IMPFN : Implicit Function Declaration

Summary

A function is invoked, but it has not yet been declared.

Properties

Class Name Implicit Function Declaration
Significance style
Mnemonic LANG.STRUCT.DECL.IMPFN
Categories
MisraC2025 MisraC2025:17.3 A function shall not be declared implicitly
MisraC2023 MisraC2023:17.3 A function shall not be declared implicitly
Misra2012 Misra2012:17.3 A function shall not be declared implicitly
Misra2004 Misra2004:8.1 Functions shall have prototype declarations and the prototype shall be visible at both the function definition and call
AUTOSARC++14 AUTOSARC++14:A1-1-1 All code shall conform to ISO/IEC 14882:2014 - Programming Language C++ and shall not use deprecated features.
MisraC++2023 MisraC++2023:4.1.2 Deprecated features should not be used
  MisraC++2023:6.5.1 A function or object with external linkage should be introduced in a header file
CWE CWE:686 Function Call With Incorrect Argument Type
CERT-C CERT-C:MSC23-C Beware of vendor-specific library and language differences
Availability Available for C and C++.
Enabling Checks for this warning class are enabled by default. However, warning instances of this class that are issued as parser errors (rather than parser warnings) will be discarded when using factory configuration settings. To prevent these instances from being discarded, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="Implicit Function Declaration"
To disable checks for this warning class, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Implicit Function Declaration"

Example

int f(double a);   
 
int lang_struct_decl_impfn_before(double a){
    return f(a);                                          /* f() already declared */             
}
 
int lang_struct_decl_impfn_none(double a){
    return g(a);                 /* 'Implicit Function Declaration' warning issued here
                                  * - g() never declared */
}
 
int lang_struct_decl_impfn_after(double a){
  return h(a);                   /* 'Implicit Function Declaration' warning issued here
                                  * - h() declared after invocation */
}

int h(double a);

Relevant Configuration File Parameters

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

 

To report problems with this documentation, please visit https://support.codesecure.com/.