* [Buildroot] [PATCH] package/atop: fix implicit waddwstr declaration
@ 2026-08-15 15:41 Shubham Chakraborty
2026-09-01 21:34 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Shubham Chakraborty @ 2026-08-15 15:41 UTC (permalink / raw)
To: buildroot; +Cc: Shubham Chakraborty, Ricardo Martincoski
atop uses wide-character ncurses functions such as `waddwstr` (e.g., in
drawbar.c). For `<curses.h>` to expose the prototypes for these wide-character
functions, the `_XOPEN_SOURCE_EXTENDED` macro must be defined before the
header is included.
Without these macros defined, the preprocessor skips the function prototypes.
drawbar.c:2336:33: error: implicit declaration of function 'waddwstr'
This commit fixes the build failure by adding `-D_XOPEN_SOURCE_EXTENDED`
and `-DNCURSES_WIDECHAR` to `ATOP_CFLAGS`, ensuring the ncurses headers
correctly expose the required wide-character prototypes.
Fixes :
- https://autobuild.buildroot.org/results/b91/b91ea0722202de0d1fdeeaeea167fd1b21b6d5d6
Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
---
package/atop/atop.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/atop/atop.mk b/package/atop/atop.mk
index 677b60ac1b..6b2c114e91 100644
--- a/package/atop/atop.mk
+++ b/package/atop/atop.mk
@@ -11,7 +11,7 @@ ATOP_LICENSE_FILES = COPYING
ATOP_CPE_ID_VALID = YES
ATOP_DEPENDENCIES = ncurses zlib libglib2 host-pkgconf
-ATOP_CFLAGS = $(TARGET_CFLAGS)
+ATOP_CFLAGS = $(TARGET_CFLAGS) -D_XOPEN_SOURCE_EXTENDED -DNCURSES_WIDECHAR
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
ATOP_CFLAGS += -O0
--
2.55.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] package/atop: fix implicit waddwstr declaration
2026-08-15 15:41 [Buildroot] [PATCH] package/atop: fix implicit waddwstr declaration Shubham Chakraborty
@ 2026-09-01 21:34 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-09-01 21:34 UTC (permalink / raw)
To: Shubham Chakraborty; +Cc: buildroot, Ricardo Martincoski
Hello,
On Sat, Aug 15, 2026 at 09:11:19PM +0530, Shubham Chakraborty wrote:
> atop uses wide-character ncurses functions such as `waddwstr` (e.g., in
> drawbar.c). For `<curses.h>` to expose the prototypes for these wide-character
> functions, the `_XOPEN_SOURCE_EXTENDED` macro must be defined before the
> header is included.
> Without these macros defined, the preprocessor skips the function prototypes.
>
> drawbar.c:2336:33: error: implicit declaration of function 'waddwstr'
>
> This commit fixes the build failure by adding `-D_XOPEN_SOURCE_EXTENDED`
> and `-DNCURSES_WIDECHAR` to `ATOP_CFLAGS`, ensuring the ncurses headers
> correctly expose the required wide-character prototypes.
>
> Fixes :
> - https://autobuild.buildroot.org/results/b91/b91ea0722202de0d1fdeeaeea167fd1b21b6d5d6
>
> Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
This is lacking the usual information of since when it is
happening. Was it working before? Yes/no? If it used to work and now
it breaks, why?
Based on https://autobuild.buildroot.net/?reason=atop-%25 it seems
like up to the bump to version 2.13.0 we had both a uclibc build
failure:
/home/thomas/autobuild/instance-1/output-1/host/i686-buildroot-linux-uclibc/sysroot/usr/include/features.h:167:22: error: operator '<' has no left operand
167 | # if _POSIX_C_SOURCE < 200809L
and a musl build failure:
drawbar.c:2336:33: error: implicit declaration of function 'waddwstr'; did you mean 'waddstr'? [-Wimplicit-function-declaration]
2336 | waddwstr(w->win, L"┃");
| ^~~~~~~~
| waddstr
but now with the version bump this issue only happens with musl. So
why does it only happen with musl? Your analysis points to a problem
that would seem to be independent of the C library, but it apparently
isn't.
So again, I don't doubt that your patch fixes the build issue, but the
explanation is not convincing enough that what you're proposing is the
right solution. Indeed your explanation says that those defines are
ALWAYS needed to access waddwstr, but the simple fact that the package
seems to build fine with glibc and uclibc proves that this affirmation
is incorrect.
Could you do more research on this?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-01 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-15 15:41 [Buildroot] [PATCH] package/atop: fix implicit waddwstr declaration Shubham Chakraborty
2026-09-01 21:34 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox