summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-04-09 20:14:22 +0200
committerGuillem Jover <guillem@debian.org>2014-04-21 16:54:29 +0200
commit639786e29c72baf6b1f0b2ca1cada34df54d8dff (patch)
treee9e4781b297e45505fd35a635d575c3540cb571a
parent09d43d4f21f6b70c0c1aff2711a1503d7ecf8a35 (diff)
downloaddpkg-639786e29c72baf6b1f0b2ca1cada34df54d8dff.tar.gz
build: Test for required compound literals
And clarify the comment on the designated initializers.
-rw-r--r--debian/changelog1
-rw-r--r--doc/coding-style.txt3
-rw-r--r--m4/dpkg-compiler.m46
3 files changed, 8 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 3562971a7..968615665 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -71,6 +71,7 @@ dpkg (1.17.7) UNRELEASED; urgency=low
* Set TAR preprocessor variable at build time instead of hardcoding it.
This will allow non-GNU systems to easily use another value for their
GNU tar, which is usually either gnutar or gtar.
+ * Require compound literals support in the compiler at configure time.
[ Updated dpkg translations ]
* German (Sven Joachim).
diff --git a/doc/coding-style.txt b/doc/coding-style.txt
index 2f18daada..3e1a30d05 100644
--- a/doc/coding-style.txt
+++ b/doc/coding-style.txt
@@ -6,7 +6,8 @@ C language extensions
The code base assumes C89 plus the following C99 extensions:
- * Named initializers.
+ * Designated initializers.
+ * Compound literals.
* Trailing comma in enum.
* Variadic macros.
* Working bool type in <stdbool.h>.
diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
index f1c760bf5..84d78164e 100644
--- a/m4/dpkg-compiler.m4
+++ b/m4/dpkg-compiler.m4
@@ -125,9 +125,13 @@ AC_DEFUN([DPKG_TRY_C99],
[[
int rc;
- /* Compound initializers. */
+ /* Designated initializers. */
struct { int a, b; } foo = { .a = 1, .b = 2 };
+ /* Compound literals. */
+ struct point { int x, y; } p = (struct point){ .x = 0, .y = 1 };
+ p = (struct point){ .x = 2, .y = 4 };
+
/* Trailing comma in enum. */
enum { first, second, } quux;