Skip to content

tgetopt: use const qualifier from pointer target type#446

Merged
ebiggers merged 1 commit intoebiggers:masterfrom
uraltun:glibc-2.43
Mar 2, 2026
Merged

tgetopt: use const qualifier from pointer target type#446
ebiggers merged 1 commit intoebiggers:masterfrom
uraltun:glibc-2.43

Conversation

@uraltun
Copy link
Copy Markdown
Contributor

@uraltun uraltun commented Mar 2, 2026

Fixes a build failure against glibc 2.43:

/<>/programs/tgetopt.c: In function ‘tgetopt’: /<>/programs/tgetopt.c:73:36: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
73 | tchar *p = tstrchr(optstring, opt);
| ^~~~~~~

Fixes a build failure against glibc 2.43:

/<<PKGBUILDDIR>>/programs/tgetopt.c: In function ‘tgetopt’:
/<<PKGBUILDDIR>>/programs/tgetopt.c:73:36: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   73 |                         tchar *p = tstrchr(optstring, opt);
      |                                    ^~~~~~~
@uraltun
Copy link
Copy Markdown
Contributor Author

uraltun commented Mar 2, 2026

Log of successful build including this change against glibc 2.43: https://launchpadlibrarian.net/849909508/buildlog_ubuntu-resolute-amd64.libdeflate_1.23-2ubuntu1~ppa1_BUILDING.txt.gz

@ebiggers ebiggers merged commit cdca9cb into ebiggers:master Mar 2, 2026
47 checks passed
@ebiggers
Copy link
Copy Markdown
Owner

ebiggers commented Mar 2, 2026

Merged, thanks. For future reference, there is more information in this glibc commit:

commit cd748a63ab1a7ae846175c532a3daab341c62690
Author: Joseph Myers <josmyers@redhat.com>
Date:   Thu Nov 20 19:30:27 2025 +0000

    Implement C23 const-preserving standard library macros
    
    C23 makes various standard library functions, that return a pointer
    into an input array, into macros that return a pointer to const when
    the relevant argument passed to the macro is a pointer to const.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants