Re: GMP bootstrap fails with Autoconf 2.69d

2020-11-15 Thread Vincent Lefevre
On 2020-11-15 23:49:10 +0100, Hans Åberg wrote:
> One can also have an additional URL argument, which defines a variable 
> PACKAGE_URL:
> 
> AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org (see 
> https://gmplib.org/manual/Reporting-Bugs.html)], gmp, [https://gmplib.org/])

If I understand correctly, the goal is to have the Reporting-Bugs.html
URL together with the e-mail address.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: uint_least32_t is in stdint.h not in inttypes.h

2020-11-15 Thread Felix von Leitner
> But ISO C99 says:

>   7.8 Format conversion of integer types 

>   The header  includes the header  [...]

> So, including  if present should be sufficient, and
> this is what the above code does.

Oh NICE that means I got a bugfix for my code out of this, too.

Thanks! :-)

Godspeed, Vincent. GMP is awesome.

Felix
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: uint_least32_t is in stdint.h not in inttypes.h

2020-11-15 Thread Vincent Lefevre
On 2020-11-15 22:21:18 +0100, Felix von Leitner wrote:
> I was trying to compile gmp with my libc, dietlibc, and got an error
> that uint_least32_t is not defined.
> 
> Well, it is defined, and as far as I can tell in the right header file,
> too: stdint.h.
> 
> However, gmp-impl.h reads as follows:
> 
>  155 #if HAVE_INTTYPES_H  /* for uint_least32_t */
>  156 # include 
>  157 #else
>  158 # if HAVE_STDINT_H
>  159 #  include 
>  160 # endif
>  161 #endif
> 
> Note that stdint.h is in the else clause. dietlibc has both
> inttypes.h and stdint.h.

But ISO C99 says:

  7.8 Format conversion of integer types 

  The header  includes the header  [...]

So, including  if present should be sufficient, and
this is what the above code does.

That said, for C99 implementations, the #if tests would be useless,
so that the above code is also designed for non-C99 implementations,
which may have  and  with a behavior different
from C99, i.e.  will not necessarily include 
(but this also means that  will not necessarily have
uint_least32_t).

> Proposed fix: Move the #if HAVE_STDINT_H outside the previous #if.

Indeed, including both headers independently (when they are available)
may be the best way to have a chance to get uint_least32_t.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bootstrap fails with Autoconf 2.69d

2020-11-15 Thread Marc Glisse

On Wed, 11 Nov 2020, Paul Eggert wrote:

The Autoconf manual has long said that the 3rd argument of AC_INIT must be an 
email address.


Which is a bad idea, we don't want people blindly sending an email, we 
want them to read instructions first. A URL makes more sense.


To fix the problem, I suggest using just [gmp-bugs@gmplib.org] as the 3rd 
argument of AC_INIT, as being the simplest; or if you want the commentary, 
put it in as valid RFC 5322 commentary, e.g., by parenthesizing it:


diff -r 18875a0a3f89 configure.ac
--- a/configure.ac  Tue Nov 10 18:17:13 2020 +0100
+++ b/configure.ac  Wed Nov 11 22:25:59 2020 -0800
@@ -37,7 +37,7 @@

AC_REVISION($Revision$)
AC_PREREQ(2.59)
-AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org, see 
https://gmplib.org/manual/Reporting-Bugs.html], gmp)
+AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org (see 
https://gmplib.org/manual/Reporting-Bugs.html)], gmp)

AC_CONFIG_SRCDIR(gmp-impl.h)
m4_pattern_forbid([^[ \t]*GMP_])
m4_pattern_allow(GMP_LDFLAGS)


Thanks, that looks like a nice workaround.

--
Marc Glisse
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


uint_least32_t is in stdint.h not in inttypes.h

2020-11-15 Thread Felix von Leitner
Dear gmp team,

I was trying to compile gmp with my libc, dietlibc, and got an error
that uint_least32_t is not defined.

Well, it is defined, and as far as I can tell in the right header file,
too: stdint.h.

However, gmp-impl.h reads as follows:

 155 #if HAVE_INTTYPES_H  /* for uint_least32_t */
 156 # include 
 157 #else
 158 # if HAVE_STDINT_H
 159 #  include 
 160 # endif
 161 #endif

Note that stdint.h is in the else clause. dietlibc has both inttypes.h and 
stdint.h.

For reference, please see:

https://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html

https://en.cppreference.com/w/c/types/integer


Proposed fix: Move the #if HAVE_STDINT_H outside the previous #if.

Regards,

Felix
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


GMP bootstrap fails with Autoconf 2.69d

2020-11-15 Thread Paul Eggert
Autoconf 2.70 is about to be released, and some people have been using 
prereleases to build lots of GNU packages. They've run into a problem with GMP, 
though, because GMP uses AC_INIT in a way contrary to the Autoconf manual, and 
changes in Autoconf mean that GMP's "./.bootstrap" procedure fails as follows:


$ ./.bootstrap
/usr/bin/m4:configure.ac:40: Warning: excess arguments to builtin `m4_define' 
ignored

autom4te: error: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: error: aclocal failed with exit status: 1

The bug occurs in the following line of configure.ac:

AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org, see 
https://gmplib.org/manual/Reporting-Bugs.html], gmp)


The Autoconf manual has long said that the 3rd argument of AC_INIT must be an 
email address. Unfortunately commas are not valid in RFC 5322 email addresses, 
and in Autoconf 2.69d the comma causes problems because a submacro interprets it 
as an argument separator. If you'd like to reproduce the bug, you can get 
Autoconf 2.69d as described here:


https://lists.gnu.org/archive/html/autoconf/2020-11/msg3.html

To fix the problem, I suggest using just [gmp-bugs@gmplib.org] as the 3rd 
argument of AC_INIT, as being the simplest; or if you want the commentary, put 
it in as valid RFC 5322 commentary, e.g., by parenthesizing it:


diff -r 18875a0a3f89 configure.ac
--- a/configure.ac  Tue Nov 10 18:17:13 2020 +0100
+++ b/configure.ac  Wed Nov 11 22:25:59 2020 -0800
@@ -37,7 +37,7 @@

 AC_REVISION($Revision$)
 AC_PREREQ(2.59)
-AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org, see 
https://gmplib.org/manual/Reporting-Bugs.html], gmp)
+AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org (see 
https://gmplib.org/manual/Reporting-Bugs.html)], gmp)

 AC_CONFIG_SRCDIR(gmp-impl.h)
 m4_pattern_forbid([^[ \t]*GMP_])
 m4_pattern_allow(GMP_LDFLAGS)


This should be portable to both older and newer Autoconf releases.

If you use Autoconf 2.69d you'll see that it also warns about a lot of obsolete 
stuff in gmp's configure.ac etc, but none of these warnings stop the build and 
they can be dealt with later.

___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs