Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removing dead links and replacing with valid ones.

...

Obsolete
Function

Recommended
Alternative

Rationale

asctime

asctime_s

Non-reentrant

atof

strtod

No error detection

atoi

strtol

No error detection

atol

strtol

No error detection

atoll

strtoll

No error detection

ctime

ctime_s

Non-reentrant

fopen

fopen_s

No exclusive access to file

freopen

freopen_s

No exclusive access to file

rewind

fseek

No error detection

setbuf

setvbuf

No error detection

The atof, atoi, atol, and atoll Many of these functions are obsolete because the strod, strtof, strtol, strtold, strtoll, strotul, and strtoull functions can emulate their usage and have more they lack robust error-handling capabilities.  See ERR07-C. Prefer functions that support error checking over equivalent functions that don't and INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs.

The fopen and freopen functions are obsolete because the fopen_s and freopen_s functions in C11 Annex K can emulate their usage and improve security by protecting the file from unauthorized access by setting its file protection [ISO/IEC 9899:2011].

The setbuf function is obsolete because setbuf does not return a value and can be emulated using setvbuf. See FIO12-C. Prefer setvbuf() to setbuf().

The rewind function is obsolete because rewind does not return a value and can be emulated using fseek. See FIO07-C. Prefer fseek() to rewind().

...

asctime and ctime functions are obsolete because they use non-reentrant static buffers and can be emulated using asctime_s and ctime_s.

Unchecked Obsolete Functions

...

...