mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
>[...] changes to the APE environment had broken Discount builds >there. The compiler is being choosy in a new way about *snprintf, >and no longer liked Csio.c:29. > >Working around this takes a one-line edit in Plan9/mkfile, as shown >in the attached patch, and results in a clean build, passes tests, >etc. > >Long form explanation from the APE docs, for curiosity's sake: > >>_C99_SNPRINTF_EXTENSION >>This extension permits the use of the return values of .I snprintf >>and .I vsnprintf . Before C99, the 1999 C standard, these functions >>usually returned the number of bytes, excluding terminating NUL, >>actually stored in the target string. (GNU, as usual, had to be >>different and returned -1 if the target string was too small.) C99 >>requires them to instead return the number of bytes, excluding >>terminating NUL, that would have been written into the target string >>if it were infinitely large or a negative value if an `encoding >>error' occurs, so old programs compiled under C99 rules will be >>prone to overrunning their buffers. This extension is a way for the >>programmer to declare that he or she understands the situation and >>has adjusted the code being compiled to compensate.
% Discount on Plan 9 % Josh Wood % 2009-06-12 # *Discount* Markdown compiler on Plan 9 ## Build % CONFIG='--enable-all-features' mk config % mk install % markdown -V markdown: discount X.Y.Z DL_TAG HEADER DEBUG SUPERSCRIPT RELAXED DIV `--enable-all-features` may be replaced by zero or more of: --enable-dl-tag Use the DL tag extension --enable-pandoc-header Use pandoc-style header blocks --enable-superscript A^B becomes A<sup>B</sup> --enable-amalloc Enable memory allocation debugging --relaxed-emphasis underscores aren't special in the middle of words --with-tabstops=N Set tabstops to N characters (default is 4) --enable-div Enable >%id% divisions --enable-alpha-list Enable (a)/(b)/(c) lists --enable-all-features Turn on all stable optional features ## Notes The supplied mkfile merely drives Discount's own configure script and then APE's *psh* environment to build the Discount source, then copies the result(s) to locations appropriate for system-wide use on Plan 9. There are a few other *mk*(1) targets: `install.libs`: Discount includes a C library and header. Installation is optional. Plan 9 binaries are statically linked. `install.man`: Add manual pages for markdown(1) and (6). `install.progs`: Extra programs. *makepage* writes complete XHTML documents, rather than fragments. *mkd2html* is similar, but produces HTML.