Skip to content

w3mbookmark.c:186:18: error: conflicting types for ‘getenv’; have ‘char *(void)’ #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
robert-scheck opened this issue Feb 9, 2025 · 1 comment

Comments

@robert-scheck
Copy link

robert-scheck commented Feb 9, 2025

Building w3m v0.5.3+git20230121 on Fedora Rawhide using GCC 15 fails like this (likely C23-related):

gcc -Wall -Wnull-dereference -I. -I. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=z13 -mtune=z14 -fasynchronous-unwind-tables -fstack-clash-protection  -I./libwc   -DHAVE_CONFIG_H -DAUXBIN_DIR=\"/usr/libexec/w3m\" -DCGIBIN_DIR=\"/usr/libexec/w3m/cgi-bin\" -DHELP_DIR=\"/usr/share/w3m\" -DETC_DIR=\"/etc\" -DCONF_DIR=\"/etc/w3m\" -DRC_DIR=\"~/.w3m\" -DLOCALEDIR=\"/usr/share/locale\"    -c -o w3mbookmark.o w3mbookmark.c
w3mbookmark.c: In function ‘main’:
w3mbookmark.c:186:18: error: conflicting types for ‘getenv’; have ‘char *(void)’
  186 |     extern char *getenv();
      |                  ^~~~~~
In file included from w3mbookmark.c:2:
/usr/include/stdlib.h:773:14: note: previous declaration of ‘getenv’ with type ‘char *(const char *)’
  773 | extern char *getenv (const char *__name) __THROW __nonnull ((1)) __wur;
      |              ^~~~~~
w3mbookmark.c:199:9: error: too many arguments to function ‘getenv’; expected 0, have 1
  199 |     p = getenv("REQUEST_METHOD");
      |         ^~~~~~ ~~~~~~~~~~~~~~~~
w3mbookmark.c:186:18: note: declared here
  186 |     extern char *getenv();
      |                  ^~~~~~
w3mbookmark.c:202:9: error: too many arguments to function ‘getenv’; expected 0, have 1
  202 |     p = getenv("CONTENT_LENGTH");
      |         ^~~~~~ ~~~~~~~~~~~~~~~~
w3mbookmark.c:186:18: note: declared here
  186 |     extern char *getenv();
      |                  ^~~~~~
w3mbookmark.c:212:9: error: too many arguments to function ‘getenv’; expected 0, have 1
  212 |     p = getenv("LOCAL_COOKIE_FILE");
      |         ^~~~~~ ~~~~~~~~~~~~~~~~~~~
w3mbookmark.c:186:18: note: declared here
  186 |     extern char *getenv();
      |                  ^~~~~~
make: *** [<builtin>: w3mbookmark.o] Error 1
@robert-scheck
Copy link
Author

Fork mentioned in #304 addresses this with https://git.sr.ht/~rkta/w3m/commit/a7287bd7568fd627f2c6e6f86bc136bf0f76d210.

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

No branches or pull requests

1 participant