Skip to content

c/syscalls.c: fix gethostname() prototype#52

Open
wishstudio wants to merge 1 commit intoscheme:masterfrom
wishstudio:master
Open

c/syscalls.c: fix gethostname() prototype#52
wishstudio wants to merge 1 commit intoscheme:masterfrom
wishstudio:master

Conversation

@wishstudio
Copy link
Copy Markdown

Fix the prototype of gethostname() function to fix gcc 15 build error:

c/syscalls.c: In function 'scm_gethostname':
c/syscalls.c:673:9: error: conflicting types for 'gethostname'; have 'int(void)'
  673 |     int gethostname();
      |         ^~~~~~~~~~~
In file included from /nix/store/fbbw928argckfii0j322346ihmllg7a7-glibc-2.42-61-dev/include/features.h:524,
                 from /nix/store/fbbw928argckfii0j322346ihmllg7a7-glibc-2.42-61-dev/include/bits/libc-header-start.h:33,
                 from /nix/store/fbbw928argckfii0j322346ihmllg7a7-glibc-2.42-61-dev/include/stdio.h:28,
                 from c/syscalls.c:6:
/nix/store/fbbw928argckfii0j322346ihmllg7a7-glibc-2.42-61-dev/include/bits/unistd.h:189:1: note: previous definition of 'gethostname' with type 'int(char *, long unsigned int)'
  189 | __NTH (gethostname (__fortify_clang_overload_arg (char *, ,__buf),
      | ^~~~~
c/syscalls.c:674:18: error: too many arguments to function 'gethostname'; expected 0, have 2
  674 |     int retval = gethostname(hostname, MAXHOSTNAMELEN);
      |                  ^~~~~~~~~~~ ~~~~~~~~
c/syscalls.c:673:9: note: declared here
  673 |     int gethostname();
      |         ^~~~~~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant