[PATCH] configure.ac: drop unnecessary gnu99 extension checks

2021-08-10 Thread Adrian Ratiu via Elfutils-devel
It is true that Clang does not support all gnu99 extensions [1],
but not all of them are used in the codebase and over time there
have been code cleanup efforts to improve Clang support.

For example after commit 779c57ea ("readelf: Pull advance_pc()
in file scope") there are no more nested function declarations
and elfutils now builds fine with Clang.

So in the interest of enabling Clang builds we remove the only
remaining blocker: the configure checks for nested functions and
variable length arrays which are also unused.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=24964
Signed-off-by: Adrian Ratiu 
---
 ChangeLog|  4 
 configure.ac | 11 ---
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 12b8f403..32f5b68d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-08-10  Adrian Ratiu  
+
+   * configure.ac (AC_CACHE_CHECK): Drop unnecessary std=gnu99 checks
+
 2021-07-28  Mark Wielaard  
 
* configure.ac (AC_CHECK_DECLS): Add reallocarray check.
diff --git a/configure.ac b/configure.ac
index 7caff2c5..c14eb9f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,17 +112,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl
 int foo (int a)
 {
   for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; return s;
-}
-
-double bar (double a, double b)
-{
-  double square (double z) { return z * z; }
-  return square (a) + square (b);
-}
-
-void baz (int n)
-{
-  struct S { int x[[n]]; };
 }])],
  ac_cv_c99=yes, ac_cv_c99=no)
 CFLAGS="$old_CFLAGS"])
-- 
2.32.0



[Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required

2021-08-10 Thread adrian.ratiu at collabora dot com via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=24964

Adrian Ratiu  changed:

   What|Removed |Added

 CC||adrian.ratiu at collabora dot 
com

--- Comment #2 from Adrian Ratiu  ---
Created attachment 13611
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13611&action=edit
Clang configure.ac fix

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required

2021-08-10 Thread adrian.ratiu at collabora dot com via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=24964

--- Comment #3 from Adrian Ratiu  ---
Hi,

Clang builds work fine after the latest fixes in the elfutils codebase, so we
can just drop the configure checks generating the failures above.

I've sent a patch for it [1] which should be enough to close this bug. Attached
it to this bug report as well.

[1] https://sourceware.org/pipermail/elfutils-devel/2021q3/004033.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.