bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autoconf can't cope with picky compiler, typo in shmbutil.h


From: Martin D Kealey
Subject: autoconf can't cope with picky compiler, typo in shmbutil.h
Date: Tue, 10 Sep 2024 21:22:59 +1000

I have this wrapper in  ~/sbin/gcc:

> #!/bin/sh
> exec /usr/bin/gcc -Werror -pedantic "$@"

so that I can fix every possible complaint about the code I'm writing.

Unfortunately, when I go “./configure --prefix=/some/where”, I get lots of
false negatives when probing for built-in functions, such as:

> checking for *isblank*... *no*


If I look in config.log I find:

> configure:15821: gcc -o conftest -g -O2   conftest.c  >&5
> conftest.c:261:6: error: conflicting types for built-in function
> 'isblank'; expected 'int(int)' [-Werror=builtin-declaration-mismatch]
>   261 | char isblank (void);
>       |      ^~~~~~~
> conftest.c:253:1: note: 'isblank' is declared in header '<ctype.h>'
>

which raises the question of *why* there's a conflicting declaration, and
*why* it's so weird, when POSIX 2023 n3054 simply says:

> *7.4.1.6* The isgraph function
> Synopsis
> #include <ctype.h>
> int isgraph(int c);


I guess the short answer is "well don't do that", but it does make autoconf
feel like it's lost touch with modern reality.

Apart from that, this managed to uncover an *actual* bug:

diff --git a/include/shmbutil.h b/include/shmbutil.h
index a8a59bf1a..1feee8535 100644
--- a/include/shmbutil.h
+++ b/include/shmbutil.h
@@ -86,7 +86,7 @@ extern int locale_utf8locale; /* XXX */
 #define UTF8_SINGLEBYTE(c)     (1)
 #define UTF8_MBFIRSTCHAR(c)    (0)

-#define*d* VALID_SINGLEBYTE_CHAR(c)  (1)
+#define VALID_SINGLEBYTE_CHAR(c)  (1)

 #endif /* !HANDLE_MULTIBYTE */

-Martin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]