ncurses: Add -std=gnu17 to CFLAGS to avoid a GCC15 error when building with glibc
authorJohn Audia <[email protected]>
Tue, 8 Jul 2025 19:43:12 +0000 (15:43 -0400)
committerRobert Marko <[email protected]>
Wed, 9 Jul 2025 08:38:27 +0000 (10:38 +0200)
commit3d776d31a4fc53c3e62cccc09e6352ab3d9da092
treed43a60ec707c1e8cea6e472a79f62f9d284893fd
parent99054fcb6a5aedcf6b65d09f886e3bb24f74d6f7
ncurses: Add -std=gnu17 to CFLAGS to avoid a GCC15 error when building with glibc

Without the newly introduced flag, building with libc ends in errors such the below.
There is an upstream fix[1], but backporting it is not straight forward.

/scratch/union/staging_dir/toolchain-x86_64_gcc-15.1.0_glibc/x86_64-openwrt-linux-gnu/include/c++/15.1.0/cstddef:81:21: error: redefinition of 'struct std::__byte_operand<unsigned char>'
   81 |   template<> struct __byte_operand<unsigned char> { using __type = byte; };
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/scratch/union/staging_dir/toolchain-x86_64_gcc-15.1.0_glibc/x86_64-openwrt-linux-gnu/include/c++/15.1.0/cstddef:78:21: note: previous definition of 'struct std::__byte_operand<unsigned char>'
   78 |   template<> struct __byte_operand<bool> { using __type = byte; };
      |                     ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [Makefile:438: ../obj_s/cursesp.o] Error 1

1. https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commit;h=394a1a6cf317912584592e33184ef550e738a4b9

Signed-off-by: John Audia <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19335
Signed-off-by: Robert Marko <[email protected]>
package/libs/ncurses/Makefile