Hi Bruno, Bruno Haible <br...@clisp.org> writes:
>> I've attached this patch fixing it. > > The patch overshoots the goal. Namely, if one systematically uses > double-quotes > for every variable access, it is harder to notice typos and copy&paste > mistakes > (which are not unfrequent in Gnulib, because we have many idioms and copy > code from one .m4 file to another). Ah, okay. I was conflicted on this because on one hand quoting variables is safer (undefined variables, special characters, etc.). However, as you mention it makes simple mistakes like typos go unnoticed. Thanks for explaining the conventions. >> or may be defined by the user > > This is not a worthy consideration. Users are not meant to set *_cv_* > values to "" or "non sense", only to "yes" and "no" (or otherwise as > appropriate for the specific AC_CACHE_CHECK invocation). > > Can you please revert the double-quotes for those two variables that > don't need it? I think I understand now. I've applied this patch removing the quotes from $ac_cv_header_endian_h which is set by AC_CHECK_HEADERS_ONCE and $GL_GENERATE_ENDIAN_H which is always set to true or false. Collin
>From 9154b1dc075796af79bce7634b70d447cf485569 Mon Sep 17 00:00:00 2001 From: Collin Funk <collin.fu...@gmail.com> Date: Thu, 30 May 2024 13:30:25 -0700 Subject: [PATCH] endian: Unquote variables that are always defined. * m4/endian.m4 (gl_ENDIAN_H): Unquote $ac_cv_header_endian_h and $GL_GENERATE_ENDIAN_H. --- ChangeLog | 6 ++++++ m4/endian_h.m4 | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d96de1066..5439029905 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-05-30 Collin Funk <collin.fu...@gmail.com> + + endian: Unquote variables that are always defined. + * m4/endian.m4 (gl_ENDIAN_H): Unquote $ac_cv_header_endian_h and + $GL_GENERATE_ENDIAN_H. + 2024-05-30 Bruno Haible <br...@clisp.org> attribute: Try harder to avoid syntax errors. diff --git a/m4/endian_h.m4 b/m4/endian_h.m4 index a3b43b25b7..3149b49227 100644 --- a/m4/endian_h.m4 +++ b/m4/endian_h.m4 @@ -1,5 +1,5 @@ # endian_h.m4 -# serial 3 +# serial 4 dnl Copyright 2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -13,7 +13,7 @@ AC_DEFUN_ONCE([gl_ENDIAN_H] AC_CHECK_HEADERS_ONCE([endian.h]) gl_CHECK_NEXT_HEADERS([endian.h]) - if test "$ac_cv_header_endian_h" = yes; then + if test $ac_cv_header_endian_h = yes; then HAVE_ENDIAN_H=1 dnl Check if endian.h defines uint16_t, uint32_t, and uint64_t. AC_CACHE_CHECK([if endian.h defines stdint types], @@ -88,7 +88,7 @@ AC_DEFUN_ONCE([gl_ENDIAN_H] fi dnl Check if endian.h works but is missing types from stdint.h. - if test "$GL_GENERATE_ENDIAN_H"; then + if test $GL_GENERATE_ENDIAN_H; then if test "$gl_cv_header_working_endian_h" = yes; then ENDIAN_H_JUST_MISSING_STDINT=1 else -- 2.45.1