[PATCH] lib/sha1.h: wrap declarations in extern "C" scope when included from C++

2009-07-20 Thread Peter Simons
>From 640f2ed9570eef3189e43ec7550b32776fdebd0f Mon Sep 17 00:00:00 2001
From: Peter Simons 
Date: Sun, 19 Jul 2009 18:25:44 +0200
Subject: [PATCH] lib/sha1.h: wrap declarations in extern "C" scope when 
included from C++

---
 lib/sha1.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/sha1.h b/lib/sha1.h
index 4ffda7a..b5f725b 100644
--- a/lib/sha1.h
+++ b/lib/sha1.h
@@ -23,6 +23,10 @@
 # include 
 # include 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define SHA1_DIGEST_SIZE 20
 
 /* Structure to save state of computation between the single steps.  */
@@ -81,4 +85,8 @@ extern int sha1_stream (FILE *stream, void *resblock);
digest.  */
 extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
 
+#ifdef __cplusplus
+}  /* extern "C" */
+#endif
+
 #endif
-- 
1.6.3.3





Re: [PATCH] lib/sha1.h: wrap declarations in extern "C" scope when included from C++

2009-07-21 Thread Peter Simons
Hi Jim,

 > Would you please adjust that patch to do the same for all lib/sha*.h
 > files as well as lib/md5.h, and (if Simon agrees) lib/md[24].h?

sure, the updated patch is attached below. 

Take care,
Peter

>From 98e9105fa23067d396f25beb8406cfe407de469d Mon Sep 17 00:00:00 2001
From: Peter Simons 
Date: Tue, 21 Jul 2009 15:22:24 +0200
Subject: [PATCH 1/2] Wrap declarations in extern "C" scope when headers are 
included from C++.

---
 lib/md2.h|8 
 lib/md4.h|8 
 lib/md5.h|8 
 lib/sha1.h   |8 
 lib/sha256.h |8 
 lib/sha512.h |8 
 6 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/lib/md2.h b/lib/md2.h
index 401604e..3535e29 100644
--- a/lib/md2.h
+++ b/lib/md2.h
@@ -22,6 +22,10 @@
 # include 
 # include 
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 # define MD2_DIGEST_SIZE 16
 
 /* Structure to save state of computation between the single steps.  */
@@ -73,4 +77,8 @@ extern int md2_stream (FILE *stream, void *resblock);
digest.  */
 extern void *md2_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
diff --git a/lib/md4.h b/lib/md4.h
index 937794c..6b49da5 100644
--- a/lib/md4.h
+++ b/lib/md4.h
@@ -22,6 +22,10 @@
 # include 
 # include 
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 # define MD4_DIGEST_SIZE 16
 
 /* Structure to save state of computation between the single steps.  */
@@ -79,4 +83,8 @@ extern int md4_stream (FILE * stream, void *resblock);
digest.  */
 extern void *md4_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
diff --git a/lib/md5.h b/lib/md5.h
index 3ae657b..0769edb 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -54,6 +54,10 @@
 # define __md5_stream md5_stream
 #endif
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* Structure to save state of computation between the single steps.  */
 struct md5_ctx
 {
@@ -115,4 +119,8 @@ extern int __md5_stream (FILE *stream, void *resblock) 
__THROW;
 extern void *__md5_buffer (const char *buffer, size_t len,
   void *resblock) __THROW;
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif /* md5.h */
diff --git a/lib/sha1.h b/lib/sha1.h
index 4ffda7a..93babd2 100644
--- a/lib/sha1.h
+++ b/lib/sha1.h
@@ -23,6 +23,10 @@
 # include 
 # include 
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 #define SHA1_DIGEST_SIZE 20
 
 /* Structure to save state of computation between the single steps.  */
@@ -81,4 +85,8 @@ extern int sha1_stream (FILE *stream, void *resblock);
digest.  */
 extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
diff --git a/lib/sha256.h b/lib/sha256.h
index a63b201..3dfcb26 100644
--- a/lib/sha256.h
+++ b/lib/sha256.h
@@ -21,6 +21,10 @@
 # include 
 # include 
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* Structure to save state of computation between the single steps.  */
 struct sha256_ctx
 {
@@ -80,4 +84,8 @@ extern int sha224_stream (FILE *stream, void *resblock);
 extern void *sha256_buffer (const char *buffer, size_t len, void *resblock);
 extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
diff --git a/lib/sha512.h b/lib/sha512.h
index ed12d54..20bb09b 100644
--- a/lib/sha512.h
+++ b/lib/sha512.h
@@ -22,6 +22,10 @@
 
 # include "u64.h"
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* Structure to save state of computation between the single steps.  */
 struct sha512_ctx
 {
@@ -84,4 +88,8 @@ extern int sha384_stream (FILE *stream, void *resblock);
 extern void *sha512_buffer (const char *buffer, size_t len, void *resblock);
 extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
-- 
1.6.3.3

>From e238bc65557e9698ec90393ce3d545aaf56db41f Mon Sep 17 00:00:00 2001
From: Peter Simons 
Date: Tue, 21 Jul 2009 15:23:55 +0200
Subject: [PATCH 2/2] tests/test-sha1.c: literal strings are immutable; don't 
assign them to 'char *'

---
 tests/test-sha1.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test-sha1.c b/tests/test-sha1.c
index 0cfb309..4742138 100644
--- a/tests/test-sha1.c
+++ b/tests/test-sha1.c
@@ -25,8 +25,8 @@
 int
 main (int argc, char *argv[])
 {
-  char *in1 = "abcdefgh";
-  char *out1 = "\x42\x5a\xf1\x2a\x07\x43\x50\x2b"
+  const char *in1 = "abcdefgh";
+  const char *out1 = "\x42\x5a\xf1\x2a\x07\x43\x50\x2b"
 "\x32\x2e\x93\xa0\x15\xbc\xf8\x68\xe3\x24\xd5\x6a";
   char buf[SHA1_DIGEST_SIZE];
 
-- 
1.6.3.3



[PATCH] top/maint.mk: improved regex parser used in update-NEWS-hash

2009-08-01 Thread Peter Simons
The original version required a very specific spelling of the line:

  old_NEWS_hash = foobar

In particular, it didn't allow for \t to be used instead of blanks, and
it didn't recognize the simply-expanded assignment operator ':='.
---
 top/maint.mk |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/top/maint.mk b/top/maint.mk
index 228b414..c3e2f47 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -492,7 +492,7 @@ sc_immutable_NEWS:
 # Update the hash stored above.  Do this after each release and
 # for any corrections to old entries.
 update-NEWS-hash: NEWS
-   perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" \
+   perl -pi -e 's/^(old_NEWS_hash[ \t]+:?=[ \t]+).*/$${1}'"$(NEWS_hash)/" \
  $(srcdir)/cfg.mk
 
 # Ensure that we use only the standard $(VAR) notation,
-- 
1.6.3.3





Re: [PATCH] top/maint.mk: improved regex parser used in update-NEWS-hash

2009-08-02 Thread Peter Simons
Hi Jim,

 > Pushed with adjusted log message, i.e, to start with the
 > "module-name: " and to use ChangeLog-style "* dir/file (): ..."
 > description.

thank you for editing my patch to conform to the guidelines. 
Next time, I'll put more effort into getting that right.

Take care,
Peter




emit_upload_commands target doesn't work for savannah.nongnu.org

2010-02-14 Thread Peter Simons
Hi,

I'm using gnulib for the autoconf-archive project. To upload a new release,
I have to use the following invocation of gnupload:

  ./build-aux/gnupload --to dl.sv.nongnu.org:/releases/autoconf-archive/ file1 
file2 ...

Now, it doesn't seem possible to configure gnulib's emit_upload_commands
target to produce that command correctly. I've tried setting $(gnu_rel_host)
to "dl.sv.nongnu.org:/releases/autoconf-archive/", but unfortunately
emit_upload_commands appends the contents of $(PACKAGE) to that variable
unconditionally:

  emit_upload_commands:
  @echo =
  @echo =
  @echo "$(build_aux)/gnupload $(GNUPLOADFLAGS) \\"
  @echo "--to $(gnu_rel_host):$(PACKAGE) \\"
  @echo "  $(rel-files)"
  @echo '# send the ~/announce-$(my_distdir) e-mail'
  @echo =
  @echo =

In case of the Autoconf Archive, the outcome of "$(gnu_rel_host):$(PACKAGE)"
is never going to be correct, because there of the '/releases' bit at the
beginning of the path.

Does anyone have a suggestion how to best remedy that problem?

Take care,
Peter





Re: emit_upload_commands target doesn't work for savannah.nongnu.org

2010-02-14 Thread Peter Simons
Hi Jim,

yes, that change would solve my problem. Thank you very much.

Take care,
Peter




[PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Peter Simons
The following patches are necessary to make those modules compile in
projects that don't use a  header.




[PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Peter Simons
---
 ChangeLog |5 +
 lib/malloca.c |2 ++
 lib/md5.c |2 ++
 lib/sha1.c|2 ++
 4 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 501c267..8df0a56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-24  Peter Simons  
+
+lib/malloca.c, lib/md5.c, lib/sha1.c: don't include  unless
+HAVE_CONFIG_H is defined
+
 2010-02-23  Eric Blake  
 
warn-on-use: work with old autoconf
diff --git a/lib/malloca.c b/lib/malloca.c
index b0e6ab6..7d5c6a5 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -16,7 +16,9 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_CONFIG_H
 #include 
+#endif
 
 /* Specification.  */
 #include "malloca.h"
diff --git a/lib/md5.c b/lib/md5.c
index 4480ba8..ff3fc6d 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -20,7 +20,9 @@
 
 /* Written by Ulrich Drepper , 1995.  */
 
+#ifdef HAVE_CONFIG_H
 #include 
+#endif
 
 #include "md5.h"
 
diff --git a/lib/sha1.c b/lib/sha1.c
index 1ea84f6..f290f47 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -23,7 +23,9 @@
   Robert Klep   -- Expansion function fix
 */
 
+#ifdef HAVE_CONFIG_H
 #include 
+#endif
 
 #include "sha1.h"
 
-- 
1.7.0





Re: [PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Peter Simons
Hi Simon,

 >> The following patches are necessary to make those modules compile in
 >> projects that don't use a  header.
 >
 > That is generally not supported by gnulib. The majority of code in gnulib
 > assumes there is a config.h already; >95% if my grep is working.

given the extreme technical simplicity of supporting both builds with and
without a config.h header file, do you think that is a wise choice?

Take care,
Peter





Re: [PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-27 Thread Peter Simons
Hi Eric,

 > [Gnulib] uses so many #defines that it would exceed command-line
 > length limits on some platforms if they were passed via -D through
 > the Makefile. That, and some things don't work well through
 > makefiles, such as an expansion containing # (and gnulib now has some
 > of those for the *.in.h replacement headers). So going without any
 > header at all is no longer a portable option.

you are right. For projects of non-trivial size, config.h is clearly the
way to go.

In my particular case, however, the situation is different. The only
Gnulib module I'm interested in is MD5. At first, I assumed that I'd
need SHA1, too, but then it turned out that I don't. Anyway, I just need
a single Gnulib module and the number of Autoconf defines involved in
that build is fairly small. There is no technical reason for that
project to have a config.h header. It works just perfectly without one.

Now, I completely agree that Gnulib shouldn't try to support
non-config.h builds in general. It's not worth the effort, really. Yet,
at the same time it would feel like prudent software engineering if
Gnulib would avoid creating unnecessary obstacles for those projects
that work fine without config.h.

I see no compelling technical reason to include config.h in Gnulib code
without the proper include guards. Neither do I see a strong technical
reason to refuse my patch, which remedies the situation for the MD5 and
SHA1 module.

Anyway, this is no big deal. All things considered, I'll probably just
modify my project to use config.h. Thank you for your consideration.

Take care,
Peter





Re: [PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-03-01 Thread Peter Simons
Hi Bruno,

 > gnulib-tool offers you a way to adapt the Gnulib source to your wishes:
 > If you store a file lib/md5.c.diff in a subdirectory 'gnulib-local' of
 > your package and pass the option --local-dir=gnulib-local to the gnulib-tool
 > invocation, gnulib-tool will apply this diff when pulling lib/md5.c from
 > the Gnulib repository.

thank you very much for pointing that out. I wasn't aware of that
feature. Very nice!

Take care,
Peter





check-news target fails if NEWS file starts with a copyright header

2010-06-04 Thread Peter Simons
Hi,

the NEWS file of the GNU Autoconf Archive begins with a copyright header. As a
result, the check-news target fails, because the output of "head ./NEWS"
doesn't contain the release line that target is looking for.

I have worked around the problem by patching maint.mk as follows:

  sed -i -e 's,head $(srcdir)/NEWS,head -n 20 $(srcdir)/NEWS,' maint.mk

Maybe it's worthwhile to change that in the distribution, too?

Take care
Peter




Re: check-news target fails if NEWS file starts with a copyright header

2010-06-06 Thread Peter Simons
Karl Berry writes:

 > However, I also see no harm in looking at the first 20 lines instead
 > of the first 10 lines to match the version.

yes, I agree with Karl here. The current implementation enforces a
policy that feels rather odd. A NEWS file that features the release
heading in line 10 is considered valid, but one that features the
heading in line 11 is not. This is really quite arbitrary and not
particularly intuitive.

Take care,
Peter




Re: check-news target fails if NEWS file starts with a copyright header

2010-06-07 Thread Peter Simons
Jim Meyering wrote:

 > The penalty for an inadequate test would be to release without updating
 > NEWS.

so, according to your logic, expecting any of the top 10 lines of NEWS to
match a particular regular expression is "adequate", but expecting any of
the top, say 11 lines, of NEWS to match that expression is "inadequate"?

This reasoning doesn't make much sense to me. I think it's pretty obvious
that the choice of the 10 line limit is perfectly random in this context.
That number is inherently meaningless. Any other number, say 17 or 32, would
work just as well for all practical purposes. My impression is that your
opinion is based on irrational fears ("if we change the code, bad things
will happen") rather than on rational thought.

Take care,
Peter




Re: check-news target fails if NEWS file starts with a copyright header

2010-06-07 Thread Peter Simons
Jim Meyering wrote:

 > My wanting to minimize risk is now "irrational fears"?

No, of course not. The desire to minimize risks is perfectly reasonable.
However, your perception of the risks involved in this change strikes me
as somewhat exaggerated.


 > Is there some reason you'd rather not move the copyright notice to
 > the end of that file?

No, there is no particular reason, except that I'd have to change
several other small files, too, to keep them consistent within the
project. Since there are plenty of simple ways to avoid making that
change, I'd rather not make it.


 > If you're motivated, propose a patch.

My suggested solution is attached.

Thank you for your time and effort,
Peter

>From 34abe8ff8a000f650b22935f36240d9acda66439 Mon Sep 17 00:00:00 2001
From: Peter Simons 
Date: Mon, 7 Jun 2010 15:24:21 +0200
Subject: [PATCH] Added news-check-lines-limit variable to determine the number 
of lines that the
 'news-check' target inspects in order to find a heading for the current
 release's version number. The default value is "10". The variable can be
 overidden in cfg.mk.

---
 ChangeLog|7 +++
 top/maint.mk |5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3eb9e3a..f8bcd47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-07  Peter Simons  
+
+* top/maint.mk: Added news-check-lines-limit variable to determine
+the number of lines that the 'news-check' target inspects in order
+to find a heading for the current release's version number. The
+default value is "10". The variable can be overidden in cfg.mk.
+
 2010-06-07  Jim Meyering  
 
do-release-commit-and-tag: fix typo in --help
diff --git a/top/maint.mk b/top/maint.mk
index 644fbb6..68c3407 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -104,6 +104,7 @@ endif
 # NEWS file.
 today = $(shell date +%Y-%m-%d)
 news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
+news-check-lines-limit ?= 10
 
 # Prevent programs like 'sort' from considering distinct strings to be equal.
 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
@@ -874,8 +875,8 @@ sc_makefile_at_at_check:
  && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
 news-check: NEWS
-   if head $(srcdir)/NEWS | grep -E $(news-check-regexp)   \
-   >/dev/null; then\
+   if head -n $(news-check-lines-limit) $(srcdir)/NEWS \
+   | grep -E $(news-check-regexp) >/dev/null; then \
  :;\
else\
  echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2;  \
-- 
1.7.1



Re: check-news target fails if NEWS file starts with a copyright header

2010-06-08 Thread Peter Simons
Hi Jim,

 > How about removing the use of "head" and using this as the default:
 >
 > sed -n 1,10p

yes, that is a really good idea.

Take care,
Peter


>From b0e59e16e848f5a6f65fb2a8d5cb16a5355a8a37 Mon Sep 17 00:00:00 2001
From: Peter Simons 
Date: Mon, 7 Jun 2010 15:24:21 +0200
Subject: [PATCH] Introduced the $(news-check-lines-spec) variable in maint.mk.

$(news-check-lines-spec) determines the range of lines inspected by
the 'news-check' target to ensure that the NEWS file is up-to-date.
The default value is "1,10", meaning that any of lines 1 to 10 must
match $(news-check-regexp) for the test to succeed.
---
 ChangeLog|8 
 top/maint.mk |5 +++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3eb9e3a..ca5b2ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-06-08  Peter Simons  
+
+* top/maint.mk: Introduced the variable $(news-check-lines-spec) to
+determine the range of lines inspected by the 'news-check' target to
+ensure that the NEWS file is up-to-date. The default value is "1,10",
+meaning that any of lines 1 to 10 must match $(news-check-regexp) for
+the test to succeed.
+
 2010-06-07  Jim Meyering  
 
do-release-commit-and-tag: fix typo in --help
diff --git a/top/maint.mk b/top/maint.mk
index 644fbb6..f7c4ddd 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -104,6 +104,7 @@ endif
 # NEWS file.
 today = $(shell date +%Y-%m-%d)
 news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
+news-check-lines-spec ?= 1,10
 
 # Prevent programs like 'sort' from considering distinct strings to be equal.
 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
@@ -874,8 +875,8 @@ sc_makefile_at_at_check:
  && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
 news-check: NEWS
-   if head $(srcdir)/NEWS | grep -E $(news-check-regexp)   \
-   >/dev/null; then\
+   if sed -n $(news-check-lines-spec)p $(srcdir)/NEWS  \
+   | grep -E $(news-check-regexp) >/dev/null; then \
  :;\
else\
  echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2;  \
-- 
1.7.1



Re: check-news target fails if NEWS file starts with a copyright header

2010-06-08 Thread Peter Simons
Hi Jim,

 > Any additional comments or suggestions?

no, I'm happy with the end result. Thank you.

Take care,
Peter




Fix lib/af_alg.c compilation error on Ubuntu Trusty

2018-06-02 Thread Peter Simons
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 will not compile this file
without this patch.

>From e8703cf52d88e1c9833753cfa446b48394a0195b Mon Sep 17 00:00:00 2001
From: Peter Simons 
Date: Sat, 2 Jun 2018 13:32:25 +0200
Subject: [PATCH] lib/af_alg.c: 'for' loop initial declarations are only
 allowed in C99 mode

---
 lib/af_alg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/af_alg.c b/lib/af_alg.c
index ded4b326b..45df62c80 100644
--- a/lib/af_alg.c
+++ b/lib/af_alg.c
@@ -45,7 +45,8 @@ alg_socket (char const *alg)
 .salg_type = "hash",
   };
   /* Avoid calling both strcpy and strlen.  */
-  for (int i = 0; (salg.salg_name[i] = alg[i]); i++)
+  int i;
+  for (i = 0; (salg.salg_name[i] = alg[i]); i++)
 if (i == sizeof salg.salg_name - 1)
   return -EINVAL;
 
-- 
2.16.3



Re: Fix lib/af_alg.c compilation error on Ubuntu Trusty

2018-06-03 Thread Peter Simons
Hi Paul,

 > Peter Simons wrote:
 >> gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 will not compile this file
 >> without this patch.
 >
 > What's the context for this?

I believe that https://travis-ci.org/peti/mapson/builds/386553484 has
all the information you'll want.

Best regards,
Peter



Re: Fix lib/af_alg.c compilation error on Ubuntu Trusty

2018-06-03 Thread Peter Simons
Hi Paul,

 > How about the attached patch instead?

yes, that patch fixes the build on travis-ci. Thank you very much for
your help!

Best regards,
Peter



max_align_t from libgnu/stddef.h conflicts with gcc 5.3.1

2016-04-01 Thread Peter Simons
Hi,

I'm using the current "master" of gnulib at v0.1-744-gf0be2ae to build a
C project on Linux/x86_64. This works fine with older compilers, but gcc
5.3.1 cannot build my project because of the following error:

gcc -DHAVE_CONFIG_H -I. -I..   -DDEBUG  -g -O2 -MT unistd.o -MD -MP -MF 
.deps/unistd.Tpo -c -o unistd.o unistd.c
In file included from unistd.h:56:0,
 from unistd.c:3:
./stddef.h:104:3: error: conflicting types for 'max_align_t'
 } max_align_t;
   ^
In file included from ./stddef.h:55:0,
 from unistd.h:56,
 from unistd.c:3:
/usr/lib64/gcc/x86_64-suse-linux/5/include/stddef.h:429:3: note: previous 
declaration of 'max_align_t' was here
 } max_align_t;
   ^
Makefile:647: recipe for target 'unistd.o' failed

Apparently, the stddef.h file provided by gnulib defines that type
differently than gcc 5.x does? Is that a known issue? Or am I using
gnulib wrong somehow?

Best regards,
Peter



Re: max_align_t from libgnu/stddef.h conflicts with gcc 5.3.1

2016-04-01 Thread Peter Simons
Hi Paul,

 > Can you reproduce the problem this way?
 >
 > ./gnulib-tool --dir foo --create-testdir unistd
 > cd foo
 > ./configure
 > make
 > make check

No, that sequence of commands gives no error. The check phase reports 12
out of 12 successful tests. The relevant bit from config.log is
available at .


 > As I understand it, GCC 5.3.1 should not need a substitute stddef.h.
 > So if your system is creating one, you need to figure out why
 > ./configure decided that stddef.h wasn't working.

Hmm. I'm observing that issue on two different Linux/x86_64 systems:
both openSUSE Tumbleweed and NixOS show the same error.


 > Look in config.log; it should say something like this:
 >
 > configure:7608: checking for max_align_t
 > [ a lot of chatter ]
 > configure:7608: result: yes

The relevant bit is at .

Apparently, the second (failing) build decides that max_align_t is not
available, but the gnulib-generate test build thinks it is. Not sure how
to explain that.

For what it's worth, the full source code of my project is available at
http://git.savannah.gnu.org/cgit/mini-httpd.git.

Best regards,
Peter



Re: max_align_t from libgnu/stddef.h conflicts with gcc 5.3.1

2016-04-04 Thread Peter Simons
Hi Paul,

 > That may be the best we can do on short notice, so I did that by installing 
 > the
 > attached. Thanks for the diagnosis.

the patch fixes the problem for me, too. Thank you very much!

Best regards,
Peter



makeinfo 4.13 support?

2016-06-07 Thread Peter Simons
Hi,

the autoconf-archive project uses the "gendocs" module to convert its
Texinfo documentation into HTML, and this used to work just fine. In
recent versions like v0.1-788-g190bc0f, however, calls to "makeinfo"
fail with the following error message:

 | Generating monolithic html... (env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= 
makeinfo --no-split --html -o autoconf-archive.html
--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual 
"/home/simons/build/autoconf-archive/doc/autoconf-archive.texi")
 | makeinfo: invalid option -- 'c'
 | Try `makeinfo --help' for more information.

I reckon that is because those builds run on Ubuntu Precise, which has
only makeinfo version 4.13 available and which doesn't support the
"--css-ref" flag.

So I was wondering whether there is any way to remedy this issue? Would
it be possible for gnulib to detect the presence of the old version and
to omit the flag in that case?

Best regards,
Peter



Re: makeinfo 4.13 support?

2016-06-08 Thread Peter Simons
Hi Paul,

 >> would it be possible for gnulib to detect the presence of the old
 >> version and to omit the flag in that case?
 >
 > Yes, that should be doable. Is that a change you could contribute?

no, I'm afraid not. :-(

Best regards,
Peter



Re: makeinfo 4.13 support?

2016-06-09 Thread Peter Simons
Hi Karl,

 > As a developer, you could just install the current texinfo yourself,
 > instead of living with what the distro decides to give you.

I suppose you are right. Normally, I wouldn't bother with ancient
software like that, but in this particular case it's not easy for me to
replace makeinfo because the environment I'm using is the one provided
by Travis-CI. Yes, I *can* compile and install my own makeinfo program
as part of my .travis.yaml script, but that's awkward and time-consuming
to set up, test, and maintain. It's all very inconvenient, basically.

If gnulib trough some miracle solves the problem for me, then that would
be great, but I'll completely understand if no-one feels like that is a
problem they would enjoy spending their spare time solving.

For the time being, I've simply disabled the "make web-manual" step from
my CI instructions, which is okay.

Best regards,
Peter