Missing/undocumented HAVE_STRERROR_R

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Missing/undocumented HAVE_STRERROR_R

Jens Alfke-2
I'm debugging a problem that involves some errors logged by SQLite via unixLogErrorAtLine(). The messages contain an errno value but not the associated message. The message is missing because the call to strerror_r() is #ifdef'd out by this line:

        #if SQLITE_THREADSAFE && defined(HAVE_STRERROR_R)

There are no other references to HAVE_STRERROR_R in the SQLite source code or in our build settings, and no mentions of it in the documentation. I did a web search, and the top hits are all copies of sqlite3.c.

I can fix this by adding -DHAVE_STRERROR_R to our compiler flags, but it seems like this flag should be documented, or even better, set automatically based on the platform.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Missing/undocumented HAVE_STRERROR_R

Yuriy M. Kaminskiy

On 03/16/18 10:12 , Jens Alfke wrote:

> I'm debugging a problem that involves some errors logged by SQLite via
> unixLogErrorAtLine(). The messages contain an errno value but not the
> associated message. The message is missing because the call to
> strerror_r() is #ifdef'd out by this line:
>
> #if SQLITE_THREADSAFE && defined(HAVE_STRERROR_R)
>
> There are no other references to HAVE_STRERROR_R in the SQLite source
> code or in our build settings, and no mentions of it in the
> documentation. I did a web search, and the top hits are all copies of
> sqlite3.c.
>
> I can fix this by adding -DHAVE_STRERROR_R to our compiler flags, but
> it seems like this flag should be documented, or even better, set
> automatically based on the platform.

I noticed that sqlite-src-${version}.zip/autoconf/configure.ac already
contains autodetection snippet for this function:
  AC_FUNC_STRERROR_R
but sqlite-src-${version}.zip/configure.ac misses this check.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users