Bug 238692 - math/prng: depends on to-be-removed gets(3)
Summary: math/prng: depends on to-be-removed gets(3)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Li-Wen Hsu
URL:
Keywords:
Depends on:
Blocks: 222796
  Show dependency treegraph
 
Reported: 2019-06-18 14:50 UTC by Ed Maste
Modified: 2019-09-01 16:47 UTC (History)
2 users (show)

See Also:


Attachments
Rolls in own function to replace venerable gets() (974 bytes, patch)
2019-06-30 20:17 UTC, Eygene Ryabinkin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2019-06-18 14:50:39 UTC
I intend to remove gets(3) in the near future and this port failed in the exp-run (PR 222796)

http://package18.nyi.freebsd.org/data/112amd64PR222796-default/2018-10-27_20h58m08s/logs/errors/prng-3.0.2.log

cc -Wall -fomit-frame-pointer -O2 -pipe  -fstack-protector -fno-strict-aliasing -std=gnu89  -fstack-protector -o pairs  pairs.o ../src/libprng.a -lm 
pairs.o: In function `main':
pairs.c:(.text+0x45): undefined reference to `gets'
pairs.c:(.text+0x98): undefined reference to `gets'
pairs.c:(.text+0xc8): undefined reference to `gets'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
Comment 1 Eygene Ryabinkin freebsd_committer 2019-06-30 20:17:12 UTC
Created attachment 205441 [details]
Rolls in own function to replace venerable gets()

The attached patch should free math/prng from gets.  The reason for not using gets_s() is that it is FreeBSD-specific and I'll try to get this patch into the upstream code.
Comment 2 Ed Maste freebsd_committer 2019-07-04 19:14:28 UTC
gets_s is actually a C11 optional interface not FreeBSD-specific, but it may indeed not be widely available and using it is probably bad for portability
Comment 3 commit-hook freebsd_committer 2019-09-01 16:46:33 UTC
A commit references this bug:

Author: lwhsu
Date: Sun Sep  1 16:46:19 UTC 2019
New revision: 510709
URL: https://svnweb.freebsd.org/changeset/ports/510709

Log:
  Add a patch to remove use of gets(3)

  PR:		238692
  Submitted by:	rea
  Reported by:	emaste
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/math/prng/Makefile
  head/math/prng/files/
  head/math/prng/files/patch-no-gets