Search code examples
c++deprecatedsuncc

"Deprecated" notation for Sun's C++ compiler?


Does the Sun compiler have a notation to mark functions as deprecated, like GCC's __attribute__ ((deprecated)) or MSVC's __declspec(deprecated)?


Solution

  • It seems that one solution that would work on any compiler that supports #warning would be:

    • Copy the header in question to a new, promoted header name
    • Remove the deprecated functions from the promoted header file
    • Add to the old header file: #warning "This header is deprecated. Please use {new header name}"