[bug #68042] gnulib compilation warnings
Arun Giridhar <[email protected]>
| Newsgroups | gmane.comp.gnu.octave.bugs |
|---|---|
| Message-ID | <[email protected]> |
Please use the bug tracker to post updates to a bug report. The mailing list is intended as a read-only notification stream. Info posted to this mailing list address won't appear in the tracker database where it is most useful.
URL:
<https://savannah.gnu.org/bugs/?68042>
Summary: gnulib compilation warnings
Group: GNU Octave
Submitter: arungiridhar
Submitted: Thu 12 Feb 2026 02:54:36 PM EST
Category: Configuration and Build System
Severity: 2 - Minor
Priority: 5 - Normal
Item Group: Unexpected Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Unlocked
Release: dev
Operating System: GNU/Linux
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Thu 12 Feb 2026 02:54:36 PM EST By: Arun Giridhar <arungiridhar>
I am reporting the gnulib compilation warnings that show up when building
Octave.
This bug report is just so that I have a link to share with the gnulib mailing
list.
These are only warnings and do not interfere with anything else.
The compiler is:
clang version 21.1.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation:
/usr/bin/../lib/gcc/x86_64-pc-linux-gnu/15.2.1
Found candidate GCC installation:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/15.2.1
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/15.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
1. A tautological comparison in lib/base64.h. Removing "ch < sizeof
base64_to_int && " from that line seems to fix it.
libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -Ilibgnu -I../libgnu -fPIC
-pthread -fopenmp -fexceptions -Wall -W -Wshadow -Wformat -Wpointer-arith
-Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align
-Wcast-qual -pipe -march=native -O3 -MT
liboctave/wrappers/libwrappers_la-base64-wrappers.lo -MD -MP -MF
liboctave/wrappers/.deps/libwrappers_la-base64-wrappers.Tpo -c
../liboctave/wrappers/base64-wrappers.c -fPIC -DPIC -o
liboctave/wrappers/.libs/libwrappers_la-base64-wrappers.o
In file included from ../liboctave/wrappers/base64-wrappers.c:35:
../libgnu/base64.h:58:13: warning: result of comparison of constant 256 with
expression of type 'unsigned char' is always true
[-Wtautological-constant-out-of-range-compare]
58 | return ch < sizeof base64_to_int && 0 <= base64_to_int[ch];
| ~~ ^ ~~~~~~~~~~~~~~~~~~~~
1 warning generated.
2. Some warnings about casting a const struct to a non-const struct, all from
the same line in lib/gl_openssl.h.
libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -Ilibgnu -I../libgnu -fPIC
-pthread -fopenmp -fexceptions -Wall -W -Wshadow -Wformat -Wpointer-arith
-Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align
-Wcast-qual -pipe -march=native -O3 -MT
liboctave/wrappers/libwrappers_la-hash-wrappers.lo -MD -MP -MF
liboctave/wrappers/.deps/libwrappers_la-hash-wrappers.Tpo -c
../liboctave/wrappers/hash-wrappers.c -fPIC -DPIC -o
liboctave/wrappers/.libs/libwrappers_la-hash-wrappers.o
In file included from ../liboctave/wrappers/hash-wrappers.c:37:
In file included from ../libgnu/md5.h:96:
../libgnu/gl_openssl.h:106:34: warning: cast from 'const struct md5_ctx *' to
'struct MD5state_st *' drops const qualifier [-Wcast-qual]
106 | _gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
| ^
In file included from ../liboctave/wrappers/hash-wrappers.c:38:
In file included from ../libgnu/sha1.h:59:
../libgnu/gl_openssl.h:106:34: warning: cast from 'const struct sha1_ctx *' to
'struct SHAstate_st *' drops const qualifier [-Wcast-qual]
106 | _gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
| ^
In file included from ../liboctave/wrappers/hash-wrappers.c:39:
In file included from ../libgnu/sha256.h:59:
../libgnu/gl_openssl.h:106:34: warning: cast from 'const struct sha256_ctx *'
to 'struct SHA256state_st *' drops const qualifier [-Wcast-qual]
106 | _gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
| ^
In file included from ../liboctave/wrappers/hash-wrappers.c:39:
In file included from ../libgnu/sha256.h:61:
../libgnu/gl_openssl.h:106:34: warning: cast from 'const struct sha256_ctx *'
to 'struct SHA256state_st *' drops const qualifier [-Wcast-qual]
106 | _gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
| ^
In file included from ../liboctave/wrappers/hash-wrappers.c:40:
In file included from ../libgnu/sha512.h:59:
../libgnu/gl_openssl.h:106:34: warning: cast from 'const struct sha512_ctx *'
to 'struct SHA512state_st *' drops const qualifier [-Wcast-qual]
106 | _gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
| ^
In file included from ../liboctave/wrappers/hash-wrappers.c:40:
In file included from ../libgnu/sha512.h:61:
../libgnu/gl_openssl.h:106:34: warning: cast from 'const struct sha512_ctx *'
to 'struct SHA512state_st *' drops const qualifier [-Wcast-qual]
106 | _gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
| ^
6 warnings generated.
3. Four instances of "-Wformat-security" in lib/openat-die.c resulting from
these two lines:
libtool: compile: clang -DHAVE_CONFIG_H -I. -I../../libgnu -I..
-fvisibility=hidden -Wno-cast-qual -Wno-conversion -Wno-float-equal
-Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter
-Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic
-Wno-tautological-constant-out-of-range-compare -Wno-sign-conversion
-Wno-type-limits -Wno-unused-const-variable -Wno-error -pipe -march=native -O3
-MT libgnu_la-openat-die.lo -MD -MP -MF .deps/libgnu_la-openat-die.Tpo -c
../../libgnu/openat-die.c -fPIC -DPIC -o .libs/libgnu_la-openat-die.o
../../libgnu/openat-die.c:38:10: warning: format string is not a string
literal (potentially insecure) [-Wformat-security]
37 | error (exit_failure, errnum,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | _("unable to record current working directory"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libgnu/openat-die.c:31:18: note: expanded from macro '_'
31 | #define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
| ^
../../libgnu/gettext.h:127:39: note: expanded from macro 'dgettext'
127 | # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext
(Msgid))
| ^
./error.h:506:39: note: expanded from macro 'error'
506 | __gl_error_call (error, status, __VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./error.h:442:44: note: expanded from macro '__gl_error_call'
442 | ? __gl_error_call1 (function, status, __VA_ARGS__) \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./error.h:431:26: note: expanded from macro '__gl_error_call1'
431 | ((function) (status, __VA_ARGS__), \
| ^~~~~~~~~~~
../../libgnu/openat-die.c:38:10: note: treat the string as an argument to
avoid this
38 | _("unable to record current working directory"));
| ^
| "%s",
../../libgnu/openat-die.c:31:18: note: expanded from macro '_'
31 | #define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
| ^
../../libgnu/gettext.h:127:39: note: expanded from macro 'dgettext'
127 | # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext
(Msgid))
| ^
./error.h:506:39: note: expanded from macro 'error'
506 | __gl_error_call (error, status, __VA_ARGS__)
| ^
./error.h:442:44: note: expanded from macro '__gl_error_call'
442 | ? __gl_error_call1 (function, status, __VA_ARGS__) \
| ^
./error.h:431:26: note: expanded from macro '__gl_error_call1'
431 | ((function) (status, __VA_ARGS__), \
| ^
../../libgnu/openat-die.c:38:10: warning: format string is not a string
literal (potentially insecure) [-Wformat-security]
37 | error (exit_failure, errnum,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | _("unable to record current working directory"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libgnu/openat-die.c:31:18: note: expanded from macro '_'
31 | #define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
| ^
../../libgnu/gettext.h:127:39: note: expanded from macro 'dgettext'
127 | # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext
(Msgid))
| ^
./error.h:506:39: note: expanded from macro 'error'
506 | __gl_error_call (error, status, __VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./error.h:446:51: note: expanded from macro '__gl_error_call'
446 | __gl_error_call1 (function, __errstatus, __VA_ARGS__); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./error.h:431:26: note: expanded from macro '__gl_error_call1'
431 | ((function) (status, __VA_ARGS__), \
| ^~~~~~~~~~~
../../libgnu/openat-die.c:38:10: note: treat the string as an argument to
avoid this
38 | _("unable to record current working directory"));
| ^
| "%s",
../../libgnu/openat-die.c:31:18: note: expanded from macro '_'
31 | #define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
| ^
../../libgnu/gettext.h:127:39: note: expanded from macro 'dgettext'
127 | # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext
(Msgid))
| ^
./error.h:506:39: note: expanded from macro 'error'
506 | __gl_error_call (error, status, __VA_ARGS__)
| ^
./error.h:446:51: note: expanded from macro '__gl_error_call'
446 | __gl_error_call1 (function, __errstatus, __VA_ARGS__); \
| ^
./error.h:431:26: note: expanded from macro '__gl_error_call1'
431 | ((function) (status, __VA_ARGS__), \
| ^
../../libgnu/openat-die.c:57:10: warning: format string is not a string
literal (potentially insecure) [-Wformat-security]
56 | error (exit_failure, errnum,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 | _("failed to return to initial working directory"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libgnu/openat-die.c:31:18: note: expanded from macro '_'
31 | #define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
| ^
../../libgnu/gettext.h:127:39: note: expanded from macro 'dgettext'
127 | # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext
(Msgid))
| ^
./error.h:506:39: note: expanded from macro 'error'
506 | __gl_error_call (error, status, __VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./error.h:442:44: note: expanded from macro '__gl_error_call'
442 | ? __gl_error_call1 (function, status, __VA_ARGS__) \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./error.h:431:26: note: expanded from macro '__gl_error_call1'
431 | ((function) (status, __VA_ARGS__), \
| ^~~~~~~~~~~
../../libgnu/openat-die.c:57:10: note: treat the string as an argument to
avoid this
57 | _("failed to return to initial working directory"));
| ^
| "%s",
../../libgnu/openat-die.c:31:18: note: expanded from macro '_'
31 | #define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
| ^
../../libgnu/gettext.h:127:39: note: expanded from macro 'dgettext'
127 | # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext
(Msgid))
| ^
./error.h:506:39: note: expanded from macro 'error'
506 | __gl_error_call (error, status, __VA_ARGS__)
| ^
./error.h:442:44: note: expanded from macro '__gl_error_call'
442 | ? __gl_error_call1 (function, status, __VA_ARGS__) \
| ^
./error.h:431:26: note: expanded from macro '__gl_error_call1'
431 | ((function) (status, __VA_ARGS__), \
| ^
../../libgnu/openat-die.c:57:10: warning: format string is not a string
literal (potentially insecure) [-Wformat-security]
56 | error (exit_failure, errnum,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 | _("failed to return to initial working directory"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libgnu/openat-die.c:31:18: note: expanded from macro '_'
31 | #define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
| ^
../../libgnu/gettext.h:127:39: note: expanded from macro 'dgettext'
127 | # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext
(Msgid))
| ^
./error.h:506:39: note: expanded from macro 'error'
506 | __gl_error_call (error, status, __VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./error.h:446:51: note: expanded from macro '__gl_error_call'
446 | __gl_error_call1 (function, __errstatus, __VA_ARGS__); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./error.h:431:26: note: expanded from macro '__gl_error_call1'
431 | ((function) (status, __VA_ARGS__), \
| ^~~~~~~~~~~
../../libgnu/openat-die.c:57:10: note: treat the string as an argument to
avoid this
57 | _("failed to return to initial working directory"));
| ^
| "%s",
../../libgnu/openat-die.c:31:18: note: expanded from macro '_'
31 | #define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
| ^
../../libgnu/gettext.h:127:39: note: expanded from macro 'dgettext'
127 | # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext
(Msgid))
| ^
./error.h:506:39: note: expanded from macro 'error'
506 | __gl_error_call (error, status, __VA_ARGS__)
| ^
./error.h:446:51: note: expanded from macro '__gl_error_call'
446 | __gl_error_call1 (function, __errstatus, __VA_ARGS__); \
| ^
./error.h:431:26: note: expanded from macro '__gl_error_call1'
431 | ((function) (status, __VA_ARGS__), \
| ^
4 warnings generated.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68042>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaY4wAAAKCRCqLAuaBUf3 Tn6wAP0VtWehXmY0gk/EW/LoVE2SPEcjy3bfdXLxjuOnN/nvXQEAgMK66xka36wG U647cpyBAc1DHESRXJ+X44YTP5mhQgs= =bNHE -----END PGP SIGNATURE-----