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++


PARSE.DE : Deprecated Entity

Summary

An occurrence of a deprecated entity.

For the sake of this warning class, a deprecated entity is an entity for which one of the following is true.

Note in particuar that if an entity is deprecated in a particular version of the applicable standard but is not treated as deprecated by your compiler, you will not see warnings of this class unless user code or an imported library explicitly indicates that the entity is deprecated.

This warning class is derived from a C/C++ parser warning.

Properties

Class Name Deprecated Entity
Significance style
Mnemonic PARSE.DE
Categories
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.
  AUTOSARC++14:A18-1-3 The std::auto_ptr type shall not be used.
MisraC++2023 MisraC++2023:4.1.2 Deprecated features should not be used
CERT-C CERT-C:MSC24-C Do not use deprecated or obsolescent functions
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="Deprecated Entity"
To disable checks for this warning class, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Deprecated Entity"

Example

/* PARSE.DE.c */
#include <stdio.h>
char *gets(char *s);
void f(void){
  char name[20];
  printf("What is your name?");
  gets(name);                      /* 'Deprecated Entity' warning issued here for all C versions
                                    * ('Use of gets' warning also issued)
                                    */
  printf("Hello %s\n", name);
}
// PARSE.DE.cpp
#include <functional>
#include <memory>

#if __cplusplus >= 201402L
[[deprecated]] void f(void);

void call_user_deprecated_fn(void){
    f();                                    // 'Deprecated Entity' warning issued here for C++14 and later
                                            // - function f() has [[deprecated]] attribute (introduced in C++14)
}
#endif

void parse_de(void) {
    std::auto_ptr<int> iptr(new int(10));
    std::auto_ptr<int> iptr2(new int(10));  // 'Deprecated Entity' warning issued here for C++11 and later
                                            // - std::auto_ptr deprecated in language standard
    std::unary_function<int, bool> uf;      // 'Deprecated Entity' warning issued here for C++11 and later
                                            // - std::unary_function deprecated in language standard
    // ... remainder of function
}

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/.