Zebrafish
Zebrafish

Reputation: 14318

LZ4 deprecated function being called within a deprecated function inside implementation

In LZ4 compression library in a header file we have a function definition which is deprecated:

/*! Obsolete decompression functions (since v1.8.0) */
LZ4_DEPRECATED("use LZ4_decompress_fast() instead") LZ4LIB_API int LZ4_uncompress (const char* source, char* dest, int outputSize);

So I won't get a deprecated compiler warning unless I call that function, right? However in a .c file there is the definition for that deprecated function, which calls LZ4_decompress_fast(), which is deprecated itself. So there's no way of compiling this, right?

// In .c file, this is a deprecated function
int LZ4_uncompress (const char* source, char* dest, int outputSize)
{
    return LZ4_decompress_fast(source, dest, outputSize); // But so is this
}

Hence a deprecated function is being called within the .c file, and it's impossible to compile. Does this make sense? How could this issue have slipped the author? It's impossible, I must be doing something wrong. It's just two files:

The header And the .c file

I'm compiling on Visual Studio and the error I get is:

Error C4996 'LZ4_decompress_fast': This function is deprecated and unsafe. Consider using LZ4_decompress_safe_partial() instead

Because the functions are marked:

__declspec(deprecated(message))

Upvotes: 0

Views: 110

Answers (0)

Related Questions