samba-wscript-c99.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. source3/wscript: Remove implict int and implicit function declarations
  2. This should fix the remaining C89isms in these configure checks.
  3. Submitted upstream: <https://gitlab.com/samba-team/samba/-/merge_requests/2807>
  4. diff --git a/source3/wscript b/source3/wscript
  5. index ca27deaa54381446..e77cd127e600f8c2 100644
  6. --- a/source3/wscript
  7. +++ b/source3/wscript
  8. @@ -1314,7 +1314,7 @@ syscall(SYS_initgroups, 16, NULL, NULL, 0);
  9. if conf.CHECK_CODE('''
  10. #include <time.h>
  11. -main() {
  12. +int main() {
  13. struct tm *tm;
  14. if (sizeof(time_t) == 8) {
  15. time_t max_time = 0x7fffffffffffffffll;
  16. @@ -1345,7 +1345,7 @@ main() {
  17. #if defined(HAVE_SYS_SYSMACROS_H)
  18. #include <sys/sysmacros.h>
  19. #endif
  20. -main() { dev_t dev = makedev(1,2); return 0; }
  21. +int main() { dev_t dev = makedev(1,2); return 0; }
  22. ''',
  23. 'HAVE_MAKEDEV',
  24. addmain=False,
  25. @@ -1355,12 +1355,13 @@ main() { dev_t dev = makedev(1,2); return 0; }
  26. #include <stdio.h>
  27. #include <limits.h>
  28. #include <signal.h>
  29. +#include <stdlib.h>
  30. void exit_on_core(int ignored) {
  31. exit(1);
  32. }
  33. -main() {
  34. +int main() {
  35. char *newpath;
  36. signal(SIGSEGV, exit_on_core);
  37. newpath = realpath("/tmp", NULL);
  38. @@ -1517,9 +1518,9 @@ main() {
  39. # Check for getcwd allowing a NULL arg.
  40. conf.CHECK_CODE('''
  41. #include <unistd.h>
  42. -main() {
  43. +int main() {
  44. char *s = getcwd(NULL,0);
  45. - exit(s != NULL ? 0 : 1);
  46. + return s != NULL ? 0 : 1;
  47. }''', 'GETCWD_TAKES_NULL', addmain=False, execute=True,
  48. msg="getcwd takes a NULL argument")