#include <complex.h> double complex foo(double complex z) { return (clog(z)); } float complex foof(float complex z) { return (clogf(z)); } long double complex fool(long double complex z) { return (clogl(z)); } cc -c foo.c foo.c:7:12: warning: implicitly declaring library function 'clog' with type '_Complex double (_Complex double)' [-Wimplicit-function-declaration] return (clog(z)); ^ foo.c:7:12: note: include the header <complex.h> or explicitly provide a declaration for 'clog' foo.c:12:12: warning: implicitly declaring library function 'clogf' with type '_Complex float (_Complex float)' [-Wimplicit-function-declaration] return (clogf(z)); ^ foo.c:12:12: note: include the header <complex.h> or explicitly provide a declaration for 'clogf' foo.c:18:12: warning: implicitly declaring library function 'clogl' with type '_Complex long double (_Complex long double)' [-Wimplicit-function-declaration] return (clogl(z)); ^ foo.c:18:12: note: include the header <complex.h> or explicitly provide a declaration for 'clogl' 3 warnings generated.
Created attachment 180028 [details] clog, clogf, clogl implementations with docs The complete was provided/taken from bde@ The patch includes a bonus patch. Someone smart or interested in patch will figure out what it does Although it is unclear whether it is needed for FreeBSD as I don't use a target where it is applicable. * include/complex.h: . Add prototypes for clog[fl]. * lib/libc/softfloat/bits64/softfloat-macros . Bonus patch. * lib/msun/Makefile: . Add s_clog[fl].c to build. . Add clog[fl].3 to installed docs. * lib/msun/Symbol.map: . Add symbols to map. * lib/msun/man/clog.3: . Document clog[fl]. * lib/msun/man/complex.3: . Document that clog[fl] now exist. * lib/msun/src/math_private.h: . Add ENTERIT(). * lib/msun/src/s_clog[fl].c: . Implementation of clog[fl]().
> > The complete was provided/taken from bde@ > Ugh. s/complete/code
Created attachment 187872 [details] Update patch to trunk as of 11/08/17 Here is an updated diff. Oddly, my old diff applied to an up-to-date trunk without the issues reported at https://lists.freebsd.org/pipermail/freebsd-numerics/2017-November/000754.html * include/complex.h: . Add prototypes for complex.h. * lib/msun/Makefile: . Add s_clog.c s_clogf.c s_clogl.c to SRC. . Add clog.3 to MAN. . MLINKS for clogf.3 amd clogl.3 * lib/msun/Symbol.map: . Expose clog, clogf, and clogl. * lib/msun/man/clog.3: . Document the functions. * lib/msun/man/complex.3: . Document availability of functions. * lib/msun/src/math_private.h: . Update ENTERI() macro. . Add ENTERIT() macro. * lib/msun/src/s_clog.c: . Implementation of double clog(double x). * lib/msun/src/s_clogf.c: . Implementation of float clogf(float x). * lib/msun/src/s_clogl.c . Implementation of long double clogl(long double x).
Fails to build on (32-bit) arm: lib/msun/src/s_clogl.c:56:2: error: "Unsupported long double format" #error "Unsupported long double format" ^
(In reply to Ed Maste from comment #4) > Fails to build on (32-bit) arm: > > lib/msun/src/s_clogl.c:56:2: error: "Unsupported long double format" > #error "Unsupported long double format" Whoops. Move s_clogl.c from COMMON_SRCS to COMMON_SRCS in the .if ${LDBL_PREC} != 53 section of Makefile. I have too many changes in Makefile to create a diff.
I've moved it in my WIP branch[1] and will commit to FreeBSD shortly. [1] https://github.com/emaste/freebsd/commit/c6bb5bc750d15eeae1ecfa8795e939829289191c
Any progress?
(In reply to sgk from comment #7) I am starting the make universe and will commit when the job finishes.
Created attachment 193337 [details] The patch with the today trivial conflicts resolved. BTW, am I right that the commit should state Submitted by: bde, Steven G. Kargl <sgk@troutmask.apl.washington.edu>
Created attachment 193340 [details] Update with move of s_clogl.c to LDBL_PREC != 53 section of the Makefile.
A commit references this bug: Author: kib Date: Sun May 13 09:54:36 UTC 2018 New revision: 333577 URL: https://svnweb.freebsd.org/changeset/base/333577 Log: Add implementations for clog(3), clogf(3), and clog(3). PR: 216863 Submitted by: bde, Steven G. Kargl <sgk@troutmask.apl.washington.edu> MFC after: 2 weeks Changes: head/include/complex.h head/lib/libc/softfloat/bits64/softfloat-macros head/lib/msun/Makefile head/lib/msun/Symbol.map head/lib/msun/man/clog.3 head/lib/msun/man/complex.3 head/lib/msun/src/math_private.h head/lib/msun/src/s_clog.c head/lib/msun/src/s_clogf.c head/lib/msun/src/s_clogl.c
A commit references this bug: Author: kib Date: Tue Jun 5 13:46:20 UTC 2018 New revision: 334654 URL: https://svnweb.freebsd.org/changeset/base/334654 Log: MFC r333577: Add implementations for clog(3), clogf(3), and clogl(3). PR: 216863 Changes: _U stable/11/ stable/11/include/complex.h stable/11/lib/libc/softfloat/bits64/softfloat-macros stable/11/lib/msun/Makefile stable/11/lib/msun/Symbol.map stable/11/lib/msun/man/clog.3 stable/11/lib/msun/man/complex.3 stable/11/lib/msun/src/math_private.h stable/11/lib/msun/src/s_clog.c stable/11/lib/msun/src/s_clogf.c stable/11/lib/msun/src/s_clogl.c
Seems like this can be closed?