<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/make-prime-list.c, branch v8.22</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.22</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.22'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2013-01-01T03:51:20Z</updated>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2013-01-01T03:51:20Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2013-01-01T02:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=77da73c75432f3c5b4beebae7b0797a1e33160bc'/>
<id>urn:sha1:77da73c75432f3c5b4beebae7b0797a1e33160bc</id>
<content type='text'>
Run "make update-copyright", but then also run this,
  perl -pi -e 's/2\d\d\d-//' tests/sample-test
to make that one script use the single most recent year number.
</content>
</entry>
<entry>
<title>factor: improve primes.h change</title>
<updated>2012-11-13T05:11:01Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2012-11-13T05:10:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0cc5ae88cf5b969188715b876fef5cb43560540c'/>
<id>urn:sha1:0cc5ae88cf5b969188715b876fef5cb43560540c</id>
<content type='text'>
This follows suggestions by Jim Meyering in
&lt;http://bugs.gnu.org/12841#34&gt;.
* src/make-prime-list.c (print_wide_uint): Change "nested" argument
to "nesting", and use it to avoid outputting lines that are too long.
* src/primes.h: Remove from git.  This can be generated by a
maintainer.  It's nicer to do so on a host with at least 128-bit
arithmetic.
</content>
</entry>
<entry>
<title>factor: maintainer builds primes.h, not builder</title>
<updated>2012-11-12T16:32:31Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2012-11-12T16:32:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f16e251dae43117c2cd19359c26ce7b5e05165b6'/>
<id>urn:sha1:f16e251dae43117c2cd19359c26ce7b5e05165b6</id>
<content type='text'>
With this change, the maintainer builds primes.h and it is part of
the tarball.  primes.h's contents are not architecture-specific.
* .gitignore: Remove /src/primes.h.
* src/factor.c: Include verify.h.
(W): New constant.  Verify that uintmax_t lacks holes
and that W is no wider than the integers used to generate primes.h.
* src/local.mk (EXTRA_DIST): Add src/primes.h.
(BUILT_SOURCES, CLEANFILES): Remove src/primes.h.
($(top_srcdir)/src/primes.h): Rename from src/primes.h.
Do not depend on src/make-prime-list.  Instead, use sub-make to
build, so that we build primes.h only if it does not exist.
* src/make-prime-list.c: Include &lt;limits.h&gt;, for ULONG_MAX.
(wide_uint): Define to uintmax_t or unsigned __int128 if not #defined.
(struct prime, binvert, process_prime): Use it instead of uintmax_t.
(print_wide_uint): New function.  This generates the proper pinv
value regardless of the width of uintmax_t on the target, so long
as the width doesn't exceed that of the width of wide_uint on the
maintainer host that generated src/primes.h.
(output_primes): Use it.  Output WIDE_UINT_BITS, too.  Let the
target compute its own lim, since its uintmax_t may be narrower
than ours.
(SZ): Remove.
* src/primes.h: New file, generated with 128-bit integers and usable
on any host where uintmax_t's width is no greater than 128 bits.
</content>
</entry>
<entry>
<title>factor: port to systems with rpl_malloc</title>
<updated>2012-11-12T16:32:31Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2012-11-12T16:16:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0d664d227cadb8cf4892e70954cd6c616192c0f8'/>
<id>urn:sha1:0d664d227cadb8cf4892e70954cd6c616192c0f8</id>
<content type='text'>
* src/make-prime-list.c (malloc): Undef.  This fixes a problem on
AIX 8.20 reported by Michael Felt in &lt;http://bugs.gnu.org/12841&gt;.
</content>
</entry>
<entry>
<title>build: don't assume uintmax_t is 64 bits</title>
<updated>2012-11-04T00:49:04Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2012-10-30T02:15:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=6108baa47e90aaefb83eb230e2e063906ca14e87'/>
<id>urn:sha1:6108baa47e90aaefb83eb230e2e063906ca14e87</id>
<content type='text'>
This was not seen to be an issue in practise,
but to make the code more robust, don't assume
uintmax_t is 64 bits.

* src/factor.c (W_TYPE_SIZE): Define based on integer limits.
* src/make-prime-list.c (output_primes): Define format width
based on integer limits.
</content>
</entry>
<entry>
<title>build: don't rely on support for '%*j' printf format</title>
<updated>2012-11-04T00:49:04Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2012-10-29T02:27:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5e9401800b186a3746e3b50981ac11b709d3742a'/>
<id>urn:sha1:5e9401800b186a3746e3b50981ac11b709d3742a</id>
<content type='text'>
* src/make-prime-list.c: Hardcode the uintmax_t width
to 16 hex digits (64 bit), to avoid this compile issue
on HPUS systems at least.
</content>
</entry>
<entry>
<title>build: avoid link failure when strerror is replaced</title>
<updated>2012-10-05T20:35:27Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-10-05T20:35:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f947735d3c4036703e03bf6970784430db1355f7'/>
<id>urn:sha1:f947735d3c4036703e03bf6970784430db1355f7</id>
<content type='text'>
When building the new make-prime-list program on a system for which
strerror is defined to rpl_strerror, we'd get a link failure.
The problem is that we're including &lt;config.h&gt; for some definitions,
but do not want the rpl_ ones, since this particular program must
not be linked against gnulib (aka libcoreutils.a).  This did not
arise on Fedora 17 or 18, but did on Debian wheezy/sid.
* src/make-prime-list.c (strerror): #undef.
Build failure introduced by commit v8.19-152-gcf67e4c.
</content>
</entry>
<entry>
<title>maint: make-prime-list: syntax conventions; be robust for large N</title>
<updated>2012-10-04T19:33:06Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-10-04T18:27:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=d836ea73400d66ecfa5ecf1287b983976342c4c4'/>
<id>urn:sha1:d836ea73400d66ecfa5ecf1287b983976342c4c4</id>
<content type='text'>
* src/make-prime-list.c: Insert spaces before parens.
(main): Abort if the 8-delta value ever exceeds 255.
</content>
</entry>
<entry>
<title>maint: make-prime-list: do not ignore write failure</title>
<updated>2012-10-04T19:33:06Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-09-23T09:33:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c6369e9004be56d427f0cc0d51d7009d727e061c'/>
<id>urn:sha1:c6369e9004be56d427f0cc0d51d7009d727e061c</id>
<content type='text'>
Even though this is just a helper program that is run solely to create
primes.h, it should not ignore a write failure.  Normally we would
simply call atexit (close_stdout), but we cannot do that from this
helper program, since it must be built before the generated header,
primes.h.  If we were to make the linking of make-prime-list depend
on libcoreutils.a, that would add all lib/*.o files to the list
of dependents of $(BUILT_HEADERS).  Then, since there is currently no
provision to ensure that a file like lib/stdio.h (another built header)
is built before the first lib/*.o file that also includes &lt;stdio.h&gt;,
some lib/*.o files would be built before lib/stdio.h and some after.
The former would provoke link failures due to undefined rpl_* functions.
* src/make-prime-list.c: Include &lt;errno.h&gt;.
(fclose): Undef, so that a definition to rpl_fclose does not
cause a link failure.
(main): Per the above, in this exceptional case, we check for fclose
and ferror failure manually, and don't worry about the ferror-only
failure case in which errno may not be relevant.
</content>
</entry>
<entry>
<title>maint: make-prime-list: avoid -Wsuggest-attribute=const warning</title>
<updated>2012-10-04T19:33:05Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-09-19T09:07:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=cf67e4cc9025ce921230b821cb7e75bce06876cd'/>
<id>urn:sha1:cf67e4cc9025ce921230b821cb7e75bce06876cd</id>
<content type='text'>
* src/make-prime-list.c: Include &lt;config.h&gt;.
(binvert): Add _GL_ATTRIBUTE_CONST.
</content>
</entry>
</feed>
