mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Bug#45288: pb2 returns a lot of compilation warnings on linux
Although the C standard mandates that sprintf return the number of bytes written, some very ancient systems (i.e. SunOS 4) returned a pointer to the buffer instead. Since these systems are not supported anymore and are hopefully long dead by now, simply remove the portability wrapper that dealt with this discrepancy. The autoconf check was causing trouble with GCC.
This commit is contained in:
parent
4f59204b49
commit
ed9ffc6b09
19 changed files with 90 additions and 164 deletions
34
configure.in
34
configure.in
|
|
@ -278,40 +278,6 @@ AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
|
|||
AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
|
||||
AC_CHECK_PROG(DVIS, tex, manual.dvi)
|
||||
|
||||
#check the return type of sprintf
|
||||
AC_MSG_CHECKING("return type of sprintf")
|
||||
AC_TRY_RUN([
|
||||
int main()
|
||||
{
|
||||
char* s = "hello";
|
||||
char buf[6];
|
||||
if((int)sprintf(buf, s) == strlen(s))
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
],
|
||||
[AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
|
||||
AC_MSG_RESULT("int")],
|
||||
[AC_TRY_RUN([
|
||||
int main()
|
||||
{
|
||||
char* s = "hello";
|
||||
char buf[6];
|
||||
if((char*)sprintf(buf,s) == buf + strlen(s))
|
||||
return 0;
|
||||
return -1;
|
||||
} ],
|
||||
[AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
|
||||
AC_MSG_RESULT("ptr")],
|
||||
[AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
|
||||
AC_MSG_RESULT("garbage")]
|
||||
)],
|
||||
# Cross compile, assume POSIX
|
||||
[AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
|
||||
AC_MSG_RESULT("int (we assume)")]
|
||||
)
|
||||
|
||||
AC_PATH_PROG(uname_prog, uname, no)
|
||||
|
||||
# We should go through this and put all the explictly system dependent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue