bug-gnulib
[Top][All Lists]
Advanced

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

Re: c99 dependencies


From: Bruno Haible
Subject: Re: c99 dependencies
Date: Mon, 25 May 2020 09:10:05 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; )

Paul Smith wrote:
> It's been pointed out on the GNU make lists that by including gnulib
> content we've effectively updated our minimum required compiler from
> C90 to C99.

Yes. This is documented in [1].

> That may be acceptable, but I think the gnulib docs (at least), if not
> gnulib-tool, should make clear that AC_PROG_CC_C99 (at least) needs to
> be added to to configure.ac.

The patch below should fix this.

You should not need to invoke AC_PROG_CC_C99, just AC_PROG_CC. The modules
which require a C99 compiler are meant to state this. But we've been lazy
at marking the modules in this way.

I've now built a test dir with an old IRIX 6.5 cc and found that these modules
need C99:

* Module 'verify'
  due to
  # define _GL_VERIFY(R, DIAGNOSTIC, ...)

* Module 'libc-config'
  due to
  #define libc_hidden_proto(name, ...)

* Module 'assert'
  due to
  # define _GL_STATIC_ASSERT(R, DIAGNOSTIC, ...)
  #  define _Static_assert(...)

* Module filenamecat-lgpl
* Module scratch_buffer
* Module glob
* Module mktime
* Module mktime-internal
* Module random_r
* Module regex
* Module timespec-add
* Module timespec-sub
  due to declaration after statement

* Module regex
  due to C99 struct initializer syntax

Possibly I could also use a very old glibc system, with
CC="gcc -ansi -pedantic -Werror"...

> Gnulib macros may also need to fail the configure if the compiler
> cannot support C99.

If the compiler does not support C99, even with extra options known to
Autoconf, and you use one of these modules, you will likely be getting
a build error. Since the 'verify' module is used pretty pervasively in
Gnulib, this applies to most packages that use Gnulib.

Bruno

[1] 
https://www.gnu.org/software/gnulib/manual/html_node/C99-features-assumed.html


2020-05-25  Bruno Haible  <address@hidden>

        Add missing C99 dependencies.
        Reported by Paul Smith <address@hidden> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00290.html>.
        * modules/assert (Depends-on): Add c99.
        * modules/filenamecat-lgpl (Depends-on): Likewise.
        * modules/libc-config (Depends-on): Likewise.
        * modules/mktime (Depends-on): Likewise.
        * modules/random_r (Depends-on): Likewise.
        * modules/regex (Depends-on): Likewise.
        * modules/scratch_buffer (Depends-on): Likewise.
        * modules/timespec-add (Depends-on): Likewise.
        * modules/timespec-sub (Depends-on): Likewise.
        * modules/verify (Depends-on): Likewise.

diff --git a/modules/assert b/modules/assert
index 900a167..668715a 100644
--- a/modules/assert
+++ b/modules/assert
@@ -5,6 +5,7 @@ Files:
 m4/assert.m4
 
 Depends-on:
+c99
 
 configure.ac:
 gl_ASSERT
diff --git a/modules/filenamecat-lgpl b/modules/filenamecat-lgpl
index a641501..09965a1 100644
--- a/modules/filenamecat-lgpl
+++ b/modules/filenamecat-lgpl
@@ -7,6 +7,7 @@ lib/filenamecat-lgpl.c
 m4/filenamecat.m4
 
 Depends-on:
+c99
 dirname-lgpl
 
 configure.ac:
diff --git a/modules/libc-config b/modules/libc-config
index 7706165..e33f6de 100644
--- a/modules/libc-config
+++ b/modules/libc-config
@@ -7,6 +7,7 @@ lib/libc-config.h
 m4/__inline.m4
 
 Depends-on:
+c99
 
 configure.ac:
 gl___INLINE
diff --git a/modules/mktime b/modules/mktime
index 17ed3cd..7594043 100644
--- a/modules/mktime
+++ b/modules/mktime
@@ -8,6 +8,7 @@ m4/mktime.m4
 
 Depends-on:
 time
+c99
 multiarch
 intprops        [test $REPLACE_MKTIME = 1]
 libc-config     [test $REPLACE_MKTIME = 1]
diff --git a/modules/random_r b/modules/random_r
index 52becd59..6fa1324 100644
--- a/modules/random_r
+++ b/modules/random_r
@@ -6,6 +6,7 @@ lib/random_r.c
 m4/random_r.m4
 
 Depends-on:
+c99
 libc-config     [test $HAVE_RANDOM_R = 0 || test $REPLACE_RANDOM_R = 1]
 stdlib
 stdint          [test $HAVE_RANDOM_R = 0 || test $REPLACE_RANDOM_R = 1]
diff --git a/modules/regex b/modules/regex
index 9d77df7..b987840 100644
--- a/modules/regex
+++ b/modules/regex
@@ -14,6 +14,7 @@ m4/regex.m4
 m4/mbstate_t.m4
 
 Depends-on:
+c99
 extensions
 ssize_t
 alloca-opt      [test $ac_use_included_regex = yes]
diff --git a/modules/scratch_buffer b/modules/scratch_buffer
index e59dd62..4f9a725 100644
--- a/modules/scratch_buffer
+++ b/modules/scratch_buffer
@@ -9,6 +9,7 @@ lib/malloc/scratch_buffer_grow_preserve.c
 lib/malloc/scratch_buffer_set_array_size.c
 
 Depends-on:
+c99
 libc-config
 stdbool
 stddef
diff --git a/modules/timespec-add b/modules/timespec-add
index c7ca395..68050bf 100644
--- a/modules/timespec-add
+++ b/modules/timespec-add
@@ -5,6 +5,7 @@ Files:
 lib/timespec-add.c
 
 Depends-on:
+c99
 intprops
 timespec
 
diff --git a/modules/timespec-sub b/modules/timespec-sub
index 3ec70b3..f442cea 100644
--- a/modules/timespec-sub
+++ b/modules/timespec-sub
@@ -5,6 +5,7 @@ Files:
 lib/timespec-sub.c
 
 Depends-on:
+c99
 intprops
 timespec
 
diff --git a/modules/verify b/modules/verify
index 5216ce8..f3fe9f0 100644
--- a/modules/verify
+++ b/modules/verify
@@ -5,6 +5,7 @@ Files:
 lib/verify.h
 
 Depends-on:
+c99
 
 configure.ac:
 




reply via email to

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