[Snek] [keith-packard/snek] ad1467: Document readline dependency

Rhys Kidd noreply at github.com
Thu Feb 13 08:47:07 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/keith-packard/snek
  Commit: ad1467093d6993aed197be86c1ff3aea019669c5
      https://github.com/keith-packard/snek/commit/ad1467093d6993aed197be86c1ff3aea019669c5
  Author: Rhys Kidd <rhyskidd at gmail.com>
  Date:   2020-02-13 (Thu, 13 Feb 2020)

  Changed paths:
    M README.md

  Log Message:
  -----------
  Document readline dependency

GNU readline has been a dependency since d319ebd. Document this within the initial build
instructions.

Fixes the following compiler error, due to the missing dependency:

snek-main.c:17:10: fatal error: readline/readline.h: No such file or directory
   17 | #include <readline/readline.h>
      |          ^~~~~~~~~~~~~~~~~~~~~

Fixes: d319ebd ("Track parsing status to allow separate middle-of-statement prompts")
Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 54ab0d8c1cabbd73350492b0f030bd9b1c73854f
      https://github.com/keith-packard/snek/commit/54ab0d8c1cabbd73350492b0f030bd9b1c73854f
  Author: Rhys Kidd <rhyskidd at gmail.com>
  Date:   2020-02-13 (Thu, 13 Feb 2020)

  Changed paths:
    M README.md
    M ports/duemilanove/Makefile
    M ports/itsybitsy3v/Makefile
    M ports/itsybitsy5v/Makefile
    M ports/mega/Makefile
    M ports/uduino/Makefile

  Log Message:
  -----------
  Document dependency on a GNU awk extension

strtonum() is a GNU awk (gawk)-only extension. It is not portable, and other
implementations of awk may not support it.

Accordingly, document the dependency upon gawk specifically, and ensure snek
only calls gawk in it's Makefiles.

See further:
  - https://www.gnu.org/software/gawk/manual/html_node/Strtonum-Function.html
  - https://www.gnu.org/software/gawk/manual/html_node/String-Functions.html#index-strtonum_0028_0029-function-_0028gawk_0029

Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 411e10ff307e5ac6ab83d7a864be59f50243895a
      https://github.com/keith-packard/snek/commit/411e10ff307e5ac6ab83d7a864be59f50243895a
  Author: Rhys Kidd <rhyskidd at gmail.com>
  Date:   2020-02-13 (Thu, 13 Feb 2020)

  Changed paths:
    M hosts/windows/snek-windows.c
    M ports/posix/snek-main.c

  Log Message:
  -----------
  Close FILE handles with fclose(), as reported by Valgrind

Whilst normal program exit will see open files closed by the operating system,
this is both an implementation detail that may not hold everywhere and leads
to unnecessary message reports in a Valgrind run of snek's test suite.

Using fclose() paired with all fopen() is a good defensive coding practice.

Valgrind heap memory report:

$ valgrind --leak-check=full --show-leak-kinds=all ./ports/posix/snek test/for-range.py
==31140== Memcheck, a memory error detector
==31140== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==31140== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==31140== Command: ./ports/posix/snek test/for-range.py
==31140==
==31140==
==31140== HEAP SUMMARY:
==31140==     in use at exit: 488 bytes in 1 blocks
==31140==   total heap usage: 2 allocs, 1 frees, 4,584 bytes allocated
==31140==
==31140== 488 bytes in 1 blocks are still reachable in loss record 1 of 1
==31140==    at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==31140==    by 0x4A8B9FD: __fopen_internal (iofopen.c:65)
==31140==    by 0x4A8B9FD: fopen@@GLIBC_2.2.5 (iofopen.c:86)
==31140==    by 0x10B9CB: main (snek-main.c:108)
==31140==
==31140== LEAK SUMMARY:
==31140==    definitely lost: 0 bytes in 0 blocks
==31140==    indirectly lost: 0 bytes in 0 blocks
==31140==      possibly lost: 0 bytes in 0 blocks
==31140==    still reachable: 488 bytes in 1 blocks
==31140==         suppressed: 0 bytes in 0 blocks
==31140==
==31140== For lists of detected and suppressed errors, rerun with: -s
==31140== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
Signed-off-by: Keith Packard <keithp at keithp.com>


Compare: https://github.com/keith-packard/snek/compare/84ac993f2c49...411e10ff307e


More information about the Snek mailing list