public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Build error for wcwidth and gcvt
@ 2019-07-20  8:50 Kota Uchida
  2019-07-22  9:05 ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Kota Uchida @ 2019-07-20  8:50 UTC (permalink / raw)
  To: newlib

Hi All,

This is my first mail to newlib community.
I've send this mail because I found some build errors
on newlib's master branch.

Cygwin: unbreak the build with GCC 7
6b7723a83032bd355d3c529d957fe209cb35b4d9

I encountered 2 errors about wcwidth and gcvt.
I've pushed simple patches to forked repository:
https://github.com/uchan-nos/newlib-cygwin/commits/fix-build


Problem 1: Type confliction for wcwith.
wcwidth is declared in newlib/libc/include/wchar.h
as `int wcwidth(const wchar_t);`.
But wcwdth is defined in newlib/libc/string/wcwidth.c
as `int wcwidth(const wint_t wc)`.
These 2 declarations conflicted in my build.

How to fix this problem may not be obvious...
Modifying wint_t --> wchar_t will suppress the build error,
but it may break its functionality for the values which can't
be represented by wchar_t.


Problem 2: Type confliction for gcvt.
gcvt is declared in newlib/libc/include/stdlib.h
if __XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112.
gcvt is marked as LEGACY in POSIX.1-2001.

gcvt is defined in newlib/libc/stdlib/efgcvt.c without if-macro
so the function is always compiled.
If you compile newlib with __POSIX_VISIBLE>=200112,
a prototype declaration for gcvt is not supplied.
This causes a build error.
(Implicit declaration of gcvt conflicts with its actual type.)

This problem can be fixed as you surround definitions for
gcvt and other family functions with if-macro:
if __XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-23 12:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-20  8:50 Build error for wcwidth and gcvt Kota Uchida
2019-07-22  9:05 ` Corinna Vinschen
2019-07-22  9:47   ` Thomas Wolff
2019-07-22 10:51     ` Corinna Vinschen
2019-07-22 23:26       ` Kota Uchida
2019-07-23  7:57         ` Corinna Vinschen
2019-07-23 12:22           ` Kota Uchida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).