patch 8.2.5135: running configure gives warnings for main() return type

Problem:    Running configure gives warnings for main() return type.
Solution:   Specify "int" return type.  Avoid a few more warnings.
This commit is contained in:
Bram Moolenaar
2022-06-19 18:02:05 +01:00
parent 3efd65c557
commit 0f0d3a7fb6
3 changed files with 28 additions and 26 deletions

26
src/auto/configure vendored
View File

@ -7013,7 +7013,7 @@ else
* Only the first python version used will be switched on. * Only the first python version used will be switched on.
*/ */
int no_rtl_global_needed_for(char *python_instsoname, char *prefix) static int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
{ {
int needed = 0; int needed = 0;
void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL);
@ -7032,7 +7032,7 @@ else
return !needed; return !needed;
} }
int main(int argc, char** argv) int main()
{ {
int not_needed = 0; int not_needed = 0;
if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}")) if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}"))
@ -7079,7 +7079,7 @@ else
* Only the first python version used will be switched on. * Only the first python version used will be switched on.
*/ */
int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) static int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
{ {
int needed = 0; int needed = 0;
void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL);
@ -7098,7 +7098,7 @@ else
return !needed; return !needed;
} }
int main(int argc, char** argv) int main()
{ {
int not_needed = 0; int not_needed = 0;
if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}")) if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}"))
@ -9209,7 +9209,7 @@ else
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() int main()
{ {
if (sizeof(wchar_t) <= 2) if (sizeof(wchar_t) <= 2)
exit(1); exit(1);
@ -10751,7 +10751,7 @@ else
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } int main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }
_ACEOF _ACEOF
if ac_fn_c_try_run "$LINENO"; then : if ac_fn_c_try_run "$LINENO"; then :
@ -11973,7 +11973,7 @@ else
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); } int main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }
_ACEOF _ACEOF
if ac_fn_c_try_run "$LINENO"; then : if ac_fn_c_try_run "$LINENO"; then :
res="OK" res="OK"
@ -12050,7 +12050,7 @@ else
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() int main()
{char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }
_ACEOF _ACEOF
@ -12099,7 +12099,7 @@ else
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() int main()
{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
_ACEOF _ACEOF
@ -12464,7 +12464,7 @@ else
#include <unistd.h> #include <unistd.h>
#endif #endif
char *dagger[] = { "IFS=pwd", 0 }; char *dagger[] = { "IFS=pwd", 0 };
main() int main()
{ {
char buffer[500]; char buffer[500];
extern char **environ; extern char **environ;
@ -13128,7 +13128,7 @@ else
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
main() {struct stat st; exit(stat("configure/", &st) != 0); } int main() {struct stat st; exit(stat("configure/", &st) != 0); }
_ACEOF _ACEOF
if ac_fn_c_try_run "$LINENO"; then : if ac_fn_c_try_run "$LINENO"; then :
@ -14282,7 +14282,7 @@ else
#ifdef HAVE_INTTYPES_H #ifdef HAVE_INTTYPES_H
# include <inttypes.h> # include <inttypes.h>
#endif #endif
main() { int main() {
uint32_t nr1 = (uint32_t)-1; uint32_t nr1 = (uint32_t)-1;
uint32_t nr2 = (uint32_t)0xffffffffUL; uint32_t nr2 = (uint32_t)0xffffffffUL;
if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) return 1; if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) return 1;
@ -14310,7 +14310,7 @@ bcopy_test_prog='
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() { int main() {
char buf[10]; char buf[10];
strcpy(buf, "abcdefghi"); strcpy(buf, "abcdefghi");
mch_memmove(buf, buf + 2, 3); mch_memmove(buf, buf + 2, 3);

View File

@ -1695,7 +1695,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then
* Only the first python version used will be switched on. * Only the first python version used will be switched on.
*/ */
int no_rtl_global_needed_for(char *python_instsoname, char *prefix) static int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
{ {
int needed = 0; int needed = 0;
void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL);
@ -1714,7 +1714,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then
return !needed; return !needed;
} }
int main(int argc, char** argv) int main()
{ {
int not_needed = 0; int not_needed = 0;
if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}")) if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}"))
@ -1741,7 +1741,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then
* Only the first python version used will be switched on. * Only the first python version used will be switched on.
*/ */
int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) static int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
{ {
int needed = 0; int needed = 0;
void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL);
@ -1760,7 +1760,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then
return !needed; return !needed;
} }
int main(int argc, char** argv) int main()
{ {
int not_needed = 0; int not_needed = 0;
if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}")) if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}"))
@ -2420,7 +2420,7 @@ else
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() int main()
{ {
if (sizeof(wchar_t) <= 2) if (sizeof(wchar_t) <= 2)
exit(1); exit(1);
@ -3218,7 +3218,7 @@ AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken],
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } int main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }
]])],[ ]])],[
vim_cv_toupper_broken=yes vim_cv_toupper_broken=yes
],[ ],[
@ -3442,7 +3442,7 @@ else
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }])], int main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }])],
res="OK", res="FAIL", res="FAIL") res="OK", res="FAIL", res="FAIL")
if test "$res" = "OK"; then if test "$res" = "OK"; then
break break
@ -3481,7 +3481,7 @@ AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo],
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() int main()
{char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }
]])],[ ]])],[
vim_cv_terminfo=no vim_cv_terminfo=no
@ -3507,7 +3507,7 @@ AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgetent
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() int main()
{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
]])],[ ]])],[
vim_cv_tgetent=zero vim_cv_tgetent=zero
@ -3670,7 +3670,7 @@ AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken],
#include <unistd.h> #include <unistd.h>
#endif #endif
char *dagger[] = { "IFS=pwd", 0 }; char *dagger[] = { "IFS=pwd", 0 };
main() int main()
{ {
char buffer[500]; char buffer[500];
extern char **environ; extern char **environ;
@ -3849,7 +3849,7 @@ AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_s
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
main() {struct stat st; exit(stat("configure/", &st) != 0); } int main() {struct stat st; exit(stat("configure/", &st) != 0); }
]])],[ ]])],[
vim_cv_stat_ignores_slash=yes vim_cv_stat_ignores_slash=yes
],[ ],[
@ -4238,7 +4238,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([
#ifdef HAVE_INTTYPES_H #ifdef HAVE_INTTYPES_H
# include <inttypes.h> # include <inttypes.h>
#endif #endif
main() { int main() {
uint32_t nr1 = (uint32_t)-1; uint32_t nr1 = (uint32_t)-1;
uint32_t nr2 = (uint32_t)0xffffffffUL; uint32_t nr2 = (uint32_t)0xffffffffUL;
if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) return 1; if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) return 1;
@ -4260,7 +4260,7 @@ dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
#endif #endif
main() { int main() {
char buf[10]; char buf[10];
strcpy(buf, "abcdefghi"); strcpy(buf, "abcdefghi");
mch_memmove(buf, buf + 2, 3); mch_memmove(buf, buf + 2, 3);

View File

@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
5135,
/**/ /**/
5134, 5134,
/**/ /**/