svn commit: r451623 - in head/net/tcpview: . files

Alexey Dokuchaev danfe at FreeBSD.org
Tue Oct 10 07:30:12 UTC 2017


On Mon, Oct 09, 2017 at 10:34:03AM -0700, Cy Schubert wrote:
> In message <20171009170719.GA89682 at FreeBSD.org>, Alexey Dokuchaev writes:
> > ...
> > > Added: head/net/tcpview/files/patch-hex.c
> > > @@ -0,0 +1,10 @@
> > > +--- hex.c.orig	1993-04-22 13:40:04.000000000 -0700
> > > ++++ hex.c	2017-10-06 07:25:01.182767000 -0700
> > > +@@ -85,6 +85,7 @@
> > > +   char *s;
> > > + 
> > > +   do {
> > > ++#define gets(a) fgets(a,sizeof(a),stdin)
> > > +     if( gets(str) == NULL )
> > 
> > gets(3) called only once in this port; why not simply patch that
> > single call properly instead of bringing in a "poor man's" macro?
> 
> As an example. To open discussion of possibilities.

I don't think that having this (even in some extra-guarded form) is
good *general* solution.  Macros are fragile and things can go south
when the argument is more just a simple pointer.

I'm just as all of us want gets(3) to die out, but as long as we must
provide it in libc, putting __attribute__ ((__deprecated__)) of some
sort seems as a safer approach.

./danfe


More information about the svn-ports-all mailing list