bugzilla-daemon at bugzilla.mindrot.org
2018-Jul-03 14:52 UTC
[Bug 2881] New: getdelim definition in openbsd compat conflicts with /usr/include/stdio.h on Fedora 28 with master
https://bugzilla.mindrot.org/show_bug.cgi?id=2881 Bug ID: 2881 Summary: getdelim definition in openbsd compat conflicts with /usr/include/stdio.h on Fedora 28 with master Product: Portable OpenSSH Version: 7.7p1 Hardware: Other OS: Linux Status: NEW Severity: enhancement Priority: P5 Component: Build system Assignee: unassigned-bugs at mindrot.org Reporter: jjelen at redhat.com Recent changes introduce bsd-getline.c compatibility, but the build fails for me when configured without any options: gcc -g -O2 -pipe -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -mfunction-return=thunk -mindirect-branch=thunk -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-strong -fPIE -I. -I.. -I. -I./.. -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -DHAVE_CONFIG_H -c bsd-getline.c bsd-getline.c:50:1: error: static declaration of ?getdelim? follows non-static declaration getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp) ^~~~~~~~ In file included from /usr/include/resolv.h:58, from ../openbsd-compat/getrrsetbyname.h:59, from ../openbsd-compat/openbsd-compat.h:44, from ../includes.h:175, from bsd-getline.c:36: /usr/include/stdio.h:606:20: note: previous declaration of ?getdelim? was here extern _IO_ssize_t getdelim (char **__restrict __lineptr, ^~~~~~~~ make[1]: *** [Makefile:98: bsd-getline.o] Error 1 This function is just internal and therefore it should be defined with some compat prefix to not conflict with system functions, or it should not be built if the system one can be used. Reproducer: * configure && make master on current Fedora 28. Following patch allows me to build the current master: diff --git a/openbsd-compat/bsd-getline.c b/openbsd-compat/bsd-getline.c index 681062e8..1424c39e 100644 --- a/openbsd-compat/bsd-getline.c +++ b/openbsd-compat/bsd-getline.c @@ -47,7 +47,7 @@ #include <string.h> static ssize_t -getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp) +xxx_getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp) { char *ptr, *eptr; @@ -92,7 +92,7 @@ getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp) ssize_t getline(char **buf, size_t *bufsiz, FILE *fp) { - return getdelim(buf, bufsiz, '\n', fp); + return xxx_getdelim(buf, bufsiz, '\n', fp); } #endif -- You are receiving this mail because: You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Jul-03 18:31 UTC
[Bug 2881] getdelim definition in openbsd compat conflicts with /usr/include/stdio.h on Fedora 28 with master
https://bugzilla.mindrot.org/show_bug.cgi?id=2881 Roumen Petrov <bugtrack at roumenpetrov.info> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugtrack at roumenpetrov.info --- Comment #1 from Roumen Petrov <bugtrack at roumenpetrov.info> --- No comments on proposed patch! Few lines after /usr/include/stdio.h:606: is getline declaration. For protocol in current master getdelim ( https://sourceware.org/git/?p=glibc.git;a=blob;f=libio/stdio.h;h=731f8e56f4c115a1a507b85babaa22b21efb140c;hb=HEAD#l600 ) in online 600 while get;line on 610. Real question why on this system getline is not detected? Hints: - on linux configure script defines -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE; - if _DEFAULT_SOURCE is defined then _POSIX_C_SOURCE is set to 200809L (https://sourceware.org/git/?p=glibc.git;a=blob;f=include/features.h;h=d22c32eee6a98c350cad4267b15355fb271b9818;hb=HEAD#l258); - __USE_XOPEN2K8 is set to 1 if _POSIX_C_SOURCE > 200112L or POSIX_C_SOURCE >= 200809L ( https://sourceware.org/git/?p=glibc.git;a=blob;f=include/features.h;h=d22c32eee6a98c350cad4267b15355fb271b9818;hb=HEAD#l323 ) - if __USE_XOPEN2K8 is defined stdio.h header should declare getdelim and getline . I cannot reproduce issue on other GNU C-lib (old 2.23). Why detection fail on reported system? -- You are receiving this mail because: You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Jul-04 04:32 UTC
[Bug 2881] getdelim definition in openbsd compat conflicts with /usr/include/stdio.h on Fedora 28 with master
https://bugzilla.mindrot.org/show_bug.cgi?id=2881 Darren Tucker <dtucker at dtucker.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dtucker at dtucker.net --- Comment #2 from Darren Tucker <dtucker at dtucker.net> --- (In reply to Jakub Jelen from comment #0) [...]> Reproducer: > * configure && make master on current Fedora 28.Interesting, that was one of the systems I tested on and it worked on mine. (In reply to Roumen Petrov from comment #1)> Real question why on this system getline is not detected?That's the question. Can you find that failure in config.log? -- You are receiving this mail because: You are watching someone on the CC list of the bug. You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Jul-09 09:12 UTC
[Bug 2881] getdelim definition in openbsd compat conflicts with /usr/include/stdio.h on Fedora 28 with master
https://bugzilla.mindrot.org/show_bug.cgi?id=2881 Jakub Jelen <jjelen at redhat.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #3 from Jakub Jelen <jjelen at redhat.com> --- My bad. I probably did not regenerate configure so the checks were not performed in to configure at all. Sorry for the noise. -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2021-Apr-23 05:00 UTC
[Bug 2881] getdelim definition in openbsd compat conflicts with /usr/include/stdio.h on Fedora 28 with master
https://bugzilla.mindrot.org/show_bug.cgi?id=2881 Damien Miller <djm at mindrot.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #4 from Damien Miller <djm at mindrot.org> --- closing resolved bugs as of 8.6p1 release -- You are receiving this mail because: You are watching someone on the CC list of the bug. You are watching the assignee of the bug.